mhansonp commented on a change in pull request #6430: URL: https://github.com/apache/geode/pull/6430#discussion_r645033502
########## File path: geode-core/src/distributedTest/java/org/apache/geode/internal/cache/PartitionedRegionClearDUnitTest.java ########## @@ -430,13 +423,54 @@ public void normalClearFromClient() { .isEqualTo(0); } + @Test + public void testClearTime() { + configureServers(false, true); + client1.invoke(this::initClientCache); + client2.invoke(this::initClientCache); + + accessor.invoke(() -> feed(false)); + verifyServerRegionSize(NUM_ENTRIES); + dataStore1.invoke(() -> { + PartitionedRegion partitionedRegion = (PartitionedRegion) getRegion(false); + assertThat(partitionedRegion.getCachePerfStats().getClearTime()).isEqualTo(0L); + }); + dataStore1.invoke(() -> getRegion(false).clear()); + verifyServerRegionSize(0); + dataStore1.invoke(() -> { + PartitionedRegion partitionedRegion = (PartitionedRegion) getRegion(false); + assertThat(partitionedRegion.getCachePerfStats().getClearTime()).isGreaterThan(0L); Review comment: Hmm. Less than 10 will always be true. This test is basically unnecessary if a fast machine can result in 0 nanoseconds. I find it hard to believe though that a machine can do a clear in 0 nanoseconds. Is that really the case? -- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org