RFR: 8225209: jdk/jfr/event/compiler/TestCodeSweeper.java fails
Erik Gahlin
egahlin at openjdk.org
Wed Aug 7 12:17:39 UTC 2024
Could I have a review of a PR that prevents intermittent test failures?
The test has been changed to use a RecordingStream instead of a Recording. Before the change, the test failed 4 times out of 800 runs. After the change, no failures have been observed after 5000+ test runs.
One might think the reason the test succeeds is because provokeEvents() is called again if no event arrives in the stream. This is not the case. I have verified this by removing the call to provokeEvents() in the ProvocationEvent handler.
Another possible reason is that a flush happens every second, giving more time for the CodeCacheFull or CompilationFailure events to arrive compared to an immediate call to Recording::stop(). This is also not the case. Events in the stream are sorted by their end time, so CodeCacheFull or CompilationFailure must arrive before ProvocationEvent is committed. Otherwise, the stream would not close, and the test would timeout.
I don't know why it works, but the test seems stable now.
The bug was initially filed for a test timeout, but I have only seen events not arriving in the recording, so I updated the title.
Thanks
Erik
-------------
Commit messages:
- Initial
Changes: https://git.openjdk.org/jdk/pull/20473/files
Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=20473&range=00
Issue: https://bugs.openjdk.org/browse/JDK-8225209
Stats: 42 lines in 2 files changed: 24 ins; 3 del; 15 mod
Patch: https://git.openjdk.org/jdk/pull/20473.diff
Fetch: git fetch https://git.openjdk.org/jdk.git pull/20473/head:pull/20473
PR: https://git.openjdk.org/jdk/pull/20473
More information about the hotspot-jfr-dev
mailing list