[ https://issues.apache.org/jira/browse/GEODE-10258?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17528950#comment-17528950 ]
ASF subversion and git services commented on GEODE-10258: --------------------------------------------------------- Commit e87ea66ac99fd1fc4df4e42673c7c283471f4b00 in geode's branch refs/heads/develop from Donal Evans [ https://gitbox.apache.org/repos/asf?p=geode.git;h=e87ea66ac9 ] GEODE-10258: Assert at least 1 invocation (#7624) ClearDuringNetSearchOplogRegressionTest uses an await statement to allow the timing of a region clear to be correct. An invocation of CacheObserver.afterSettingDiskRef() is used as the trigger for the await to pass and allow the clear to begin. The test was failing due to CacheObserver.afterSettingDiskRef() being invoked more than once in the await statement, but this method is expected to be invoked multiple times during the test, so occasionally the await would check and find 0 invocations,then check again and find 2 or more, causing the test to fail. Replacing the times(1) in the assertion with atLeast(1) allows the test to pass while preserving the intended behaviour of the await. Some incidental code clean-up was also done in the test to remove compiler warnings. Authored-by: Donal Evans <doev...@vmware.com> > CI: ClearDuringNetSearchOplogRegressionTest > testQueryGetWithClear FAILED > -------------------------------------------------------------------------- > > Key: GEODE-10258 > URL: https://issues.apache.org/jira/browse/GEODE-10258 > Project: Geode > Issue Type: Bug > Affects Versions: 1.15.0 > Reporter: Xiaojian Zhou > Assignee: Donal Evans > Priority: Major > Labels: needsTriage, pull-request-available > > > Task :geode-core:distributedTest > ClearDuringNetSearchOplogRegressionTest > testQueryGetWithClear FAILED > org.awaitility.core.ConditionTimeoutException: Assertion condition defined as > a lambda expression in > org.apache.geode.internal.cache.ClearDuringNetSearchOplogRegressionTest > cacheObserver.afterSettingDiskRef(); > Wanted 1 time: > -> at > org.apache.geode.internal.cache.ClearDuringNetSearchOplogRegressionTest.lambda$doConcurrentNetSearchGetAndClear$0(ClearDuringNetSearchOplogRegressionTest.java:161) > But was 2 times: > -> at > org.apache.geode.internal.cache.DiskRegion.setClearCountReference(DiskRegion.java:622) > -> at > org.apache.geode.internal.cache.DiskRegion.setClearCountReference(DiskRegion.java:622) > within 5 minutes. > at org.awaitility.core.ConditionAwaiter.await(ConditionAwaiter.java:167) > at org.awaitility.core.AssertionCondition.await(AssertionCondition.java:119) > at org.awaitility.core.AssertionCondition.await(AssertionCondition.java:31) > at org.awaitility.core.ConditionFactory.until(ConditionFactory.java:985) > at > org.awaitility.core.ConditionFactory.untilAsserted(ConditionFactory.java:769) > at > org.apache.geode.internal.cache.ClearDuringNetSearchOplogRegressionTest.doConcurrentNetSearchGetAndClear(ClearDuringNetSearchOplogRegressionTest.java:161) > at > org.apache.geode.internal.cache.ClearDuringNetSearchOplogRegressionTest.concurrentNetSearchGetAndClear(ClearDuringNetSearchOplogRegressionTest.java:145) > at > org.apache.geode.internal.cache.ClearDuringNetSearchOplogRegressionTest.testQueryGetWithClear(ClearDuringNetSearchOplogRegressionTest.java:105) > Caused by: > org.mockito.exceptions.verification.TooManyActualInvocations: > cacheObserver.afterSettingDiskRef(); > Wanted 1 time: > -> at > org.apache.geode.internal.cache.ClearDuringNetSearchOplogRegressionTest.lambda$doConcurrentNetSearchGetAndClear$0(ClearDuringNetSearchOplogRegressionTest.java:161) > But was 2 times: > -> at > org.apache.geode.internal.cache.DiskRegion.setClearCountReference(DiskRegion.java:622) > -> at > org.apache.geode.internal.cache.DiskRegion.setClearCountReference(DiskRegion.java:622) > at > org.apache.geode.internal.cache.ClearDuringNetSearchOplogRegressionTest.lambda$doConcurrentNetSearchGetAndClear$0(ClearDuringNetSearchOplogRegressionTest.java:161) -- This message was sent by Atlassian Jira (v8.20.7#820007)