Integrated: 8225209: jdk/jfr/event/compiler/TestCodeSweeper.java fails

Erik Gahlin egahlin at openjdk.org
Thu Aug 8 11:00:35 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

This pull request has now been integrated.

Changeset: 4b740d87
Author:    Erik Gahlin <egahlin at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/4b740d87ee50ba49305add4aae6490bebb6963ba
Stats:     42 lines in 2 files changed: 24 ins; 3 del; 15 mod

8225209: jdk/jfr/event/compiler/TestCodeSweeper.java fails

Reviewed-by: mgronlun

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

PR: https://git.openjdk.org/jdk/pull/20473


More information about the hotspot-jfr-dev mailing list