RFR: 8225209: jdk/jfr/event/compiler/TestCodeSweeper.java fails
Markus Grönlund
mgronlun at openjdk.org
Wed Aug 7 12:17:39 UTC 2024
On Mon, 5 Aug 2024 23:30:14 GMT, Erik Gahlin <egahlin at openjdk.org> wrote:
> 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
Marked as reviewed by mgronlun (Reviewer).
-------------
PR Review: https://git.openjdk.org/jdk/pull/20473#pullrequestreview-2224340695
More information about the hotspot-jfr-dev
mailing list