RFR: 8346875: Test jdk/jdk/jfr/event/os/TestCPULoad.java fails on macOS
Erik Gahlin
egahlin at openjdk.org
Fri Jan 24 02:28:58 UTC 2025
On Thu, 16 Jan 2025 10:46:24 GMT, Erik Gahlin <egahlin at openjdk.org> wrote:
>> Not sure if it is this line. Should we maybe add some UL tracing; enable it for the test and see if we hit this ?
>>
>>> Maybe we should do some work instead of additional sleeping?
>>
>> Could be that this helps; or increase the sleep time (but less than I did) AND do some CPU intensive work .
>
>> Could be that this helps; or increase the sleep time (but less than I did) AND do some CPU intensive work .
>
> You could keep the 100 ms and do some CPU intensive work. If it still fails, then we'll know it's not CPU work related. If we change both at once, it's harder to analyze.
>
> If I remember correctly, we didn't have sleep at all initially (2012). Then we had a smaller sleep which was later increased to 100 ms. We should probably have tried to add CPU related work instead of increasing the sleep time.
> Hi Erik @egahlin , we unfortunately still sometimes see the error after this change
I've noticed the same thing when running them in parallel locally, i.e.,
$ jtreg-conc:32 -v:a -jdk ... test/jdk/jdk/jfr
You could try adding logging (log_debug(jfr, system)("...")) and see if you can reproduce the issue. If it's not a product bug, you could try to use an event stream instead.
public static void main(String... args) throws Exception {
List<RecordedEvent> events = new CopyOnWriteArrayList<>();
try (var rs = new RecordingStream()) {
rs.setReuse(false);
rs.enable("jdk.CPULoad").withPeriod(Duration.ofMillis(50));
rs.onEvent(e -> {
events.add(e);
rs.close();
});
rs.start();
verifyEvent(events.getFirst());
}
}
private static void verifyEvent(RecordedEvent e) throws Exception {
...
}`
-------------
PR Comment: https://git.openjdk.org/jdk/pull/23136#issuecomment-2611409245
More information about the hotspot-jfr-dev
mailing list