pivotal-jbarrett commented on code in PR #7779: URL: https://github.com/apache/geode/pull/7779#discussion_r893817487
########## geode-core/src/integrationTest/java/org/apache/geode/cache/RegionExpirationIntegrationTest.java: ########## @@ -84,15 +85,16 @@ public void increaseRegionTtl() throws Exception { .setRegionTimeToLive(new ExpirationAttributes(secondTtlSeconds, DESTROY)); await().until(region::isDestroyed); - assertThat(NANOSECONDS.toSeconds(nanoTime() - startNanos)) - .isGreaterThanOrEqualTo(secondTtlSeconds); + Instant endInstant = Instant.now(); + assertThat(Duration.between(startInstant, endInstant)) + .isGreaterThanOrEqualTo(Duration.ofSeconds(secondTtlSeconds)); } @Test - public void decreaseRegionTtl() throws Exception { + public void decreaseRegionTtl() { int firstTtlSeconds = 5; Review Comment: For readability I wonder if this is clearer now that we have introduced these new time classes: ```java final Duration firstTtl = Duration.ofSeconds(5); final Duration secondTtl = Duration.ofSeconds(1); ... regionFactory.setRegionTimeToLive(new ExpirationAttributes(firstTtl.getSeconds(), DESTROY)); ... assertThat(Duration.between(startInstant, endInstant)) .isLessThan(firstTtlSeconds); ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: notifications-unsubscr...@geode.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org