RFR: 8367302: New test jdk/jfr/event/profiling/TestCPUTimeSampleQueueAutoSizes.java from JDK-8366082 is failing [v2]
Andrei Pangin
apangin at openjdk.org
Thu Sep 18 14:15:59 UTC 2025
On Thu, 18 Sep 2025 14:02:53 GMT, Johannes Bechberger <jbechberger at openjdk.org> wrote:
>> This change hopefully fixes the test failures by making the test cases more resilient.
>
> Johannes Bechberger has updated the pull request incrementally with one additional commit since the last revision:
>
> Simplify code
Thanks! Much better, indeed. Added a few more minor comments.
test/jdk/jdk/jfr/event/profiling/TestCPUTimeSampleQueueAutoSizes.java line 74:
> 72: private final List<Long> timeBoxEnds = new ArrayList<>();
> 73:
> 74: public synchronized void addEvent(LossEvent event) {
Since the test is now single-threaded, all `synchronized` are redundant.
test/jdk/jdk/jfr/event/profiling/TestCPUTimeSampleQueueAutoSizes.java line 106:
> 104: try (RecordingStream rs = new RecordingStream()) {
> 105: // setup recording
> 106: AtomicLong burstThreadId = new AtomicLong();
Does not need to be `AtomicLong`. Can be `long` and initialized right here.
test/jdk/jdk/jfr/event/profiling/TestCPUTimeSampleQueueAutoSizes.java line 130:
> 128: WHITE_BOX.busyWaitCPUTime(1000);
> 129: // going out-of-native at the end of the previous call should have triggered
> 130: // the safepoint handler, thereby also triggering the stack walkingand creation
typo: walking_and
test/jdk/jdk/jfr/event/profiling/TestCPUTimeSampleQueueAutoSizes.java line 145:
> 143: static void disableOutOfStackWalking() {
> 144: boolean supported = WHITE_BOX.cpuSamplerSetOutOfStackWalking(false);
> 145: if (!supported) {
Why not simply `assertTrue(supported, ...)`?
-------------
PR Review: https://git.openjdk.org/jdk/pull/27293#pullrequestreview-3239996378
PR Review Comment: https://git.openjdk.org/jdk/pull/27293#discussion_r2359507524
PR Review Comment: https://git.openjdk.org/jdk/pull/27293#discussion_r2359518683
PR Review Comment: https://git.openjdk.org/jdk/pull/27293#discussion_r2359523702
PR Review Comment: https://git.openjdk.org/jdk/pull/27293#discussion_r2359530422
More information about the hotspot-jfr-dev
mailing list