adoroszlai opened a new pull request #93: HDDS-2368. TestOzoneManagerDoubleBufferWithDummyResponse failing intermittently URL: https://github.com/apache/hadoop-ozone/pull/93 ## What changes were proposed in this pull request? Fix TestOzoneManagerDoubleBufferWithDummyResponse, which (very) intermittently fails at: ``` testDoubleBufferWithDummyResponse(TestOzoneManagerDoubleBufferWithDummyResponse.java:116) ``` * https://github.com/elek/ozone-ci-03/blob/master/pr/pr-hdds-2345-jsf2s/unit/hadoop-ozone/ozone-manager/org.apache.hadoop.ozone.om.ratis.TestOzoneManagerDoubleBufferWithDummyResponse.txt * https://github.com/elek/ozone-ci-03/blob/master/pr/pr-hdds-2272-bfh6s/unit/hadoop-ozone/ozone-manager/org.apache.hadoop.ozone.om.ratis.TestOzoneManagerDoubleBufferWithDummyResponse.txt Variables are set in one thread (`OzoneManagerDoubleBuffer#daemon`): https://github.com/apache/hadoop-ozone/blob/6a6558025ec35203bfd61839aadf7b2a26520222/hadoop-ozone/ozone-manager/src/main/java/org/apache/hadoop/ozone/om/ratis/OzoneManagerDoubleBuffer.java#L160-L186 and checked in the test thread: https://github.com/apache/hadoop-ozone/blob/6a6558025ec35203bfd61839aadf7b2a26520222/hadoop-ozone/ozone-manager/src/test/java/org/apache/hadoop/ozone/om/ratis/TestOzoneManagerDoubleBufferWithDummyResponse.java#L110-L117 The test waits for the first variable (`flushedTransactionCount`) to reach `bucketCount`. The other variable (`totalNumOfFlushedTransactions`) is set later, so the test thread may reach the assertion before the updater thread reaches `updateMetrics`. The proposed fix swaps check of variables in the test: wait for the second variable and let the assertion check the first one. This guarantees that both of them are updated by the time `waitFor` returns. https://issues.apache.org/jira/browse/HDDS-2368 ## How was this patch tested? Reproduced the failure by adding some sleep in `OzoneManagerDoubleBuffer#updateMetrics`. Verified the test passes with the fix despite the sleep.
---------------------------------------------------------------- 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 With regards, Apache Git Services --------------------------------------------------------------------- To unsubscribe, e-mail: hdfs-dev-unsubscr...@hadoop.apache.org For additional commands, e-mail: hdfs-dev-h...@hadoop.apache.org