RFR: 8174819: java/nio/file/WatchService/LotsOfEvents.java fails intermittently

Jaikiran Pai jpai at openjdk.java.net
Sat Sep 25 07:12:04 UTC 2021


Can I please get a review for this test-only change that aims to fix an intermittent failure in `LotsOfEvents` testcase?

As noted by Alan in the JBS issue https://bugs.openjdk.java.net/browse/JDK-8174819, the test failure is likely due to the relatively smaller poll timeout that it currently uses. IMO, this guess is proved right by the diagnostic logs that the test is currently printing, as I note in my comment in that JBS issue.

The commit in this PR increases the 2 second timeout that was used (only) in the loop to 15 seconds to make it match the poll timeout that is used outside the loop. IMO, this increase in timeout shouldn't really slow down the test, since this is the "max amount of time to wait". The 13 second additional wait would ideally only show for the "last" poll where there are no more events.

Additionally, this commit also adds a few more diagnostic logs for future use, if this test fails in future.

Do note that there's also a `testModifyEventsQueuing` test method which too uses a 2 second timeout in a loop. I haven't touched/changed that timeout, since that test hasn't yet failed (perhaps because the number of events generated there are just 100 as against 1024 in this `testOverflowEvent` test). If at all that other test fails any time in future, we can perhaps consider increasing the timeout there too.

-------------

Commit messages:
 - 8174819: java/nio/file/WatchService/LotsOfEvents.java fails intermittently

Changes: https://git.openjdk.java.net/jdk/pull/5693/files
 Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=5693&range=00
  Issue: https://bugs.openjdk.java.net/browse/JDK-8174819
  Stats: 14 lines in 1 file changed: 11 ins; 0 del; 3 mod
  Patch: https://git.openjdk.java.net/jdk/pull/5693.diff
  Fetch: git fetch https://git.openjdk.java.net/jdk pull/5693/head:pull/5693

PR: https://git.openjdk.java.net/jdk/pull/5693


More information about the nio-dev mailing list