RFR: 8374490: Test jdk/jfr/event/runtime/TestSafepointEvents.java failed: Expected event 'jdk.SafepointStateSynchronization' to be present
Greetings, fixing this test as it is racy in two sections: 1. Initialization: Event enabling happens sequentially: 1. SafepointBegin, 2. SafepointStateSynchronization, 3. SafepointEnd. 2. Teardown: The recording is stopped during a safepoint: This will only include 1 and 2 (but not 3). The test tries to handle 2, but it fails to account for event enabling during initialization. Therefore, the test can end up with three (or more) sets, where only some set "in the middle" is complete. The test fails because it removes the last set, which is correct as it is incomplete, but then expects the first set to be complete, which it might not be because events are enabled serially. Testing: jdk_jfr Markus ------------- Commit messages: - 8374490 Changes: https://git.openjdk.org/jdk/pull/30092/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=30092&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8374490 Stats: 33 lines in 1 file changed: 6 ins; 17 del; 10 mod Patch: https://git.openjdk.org/jdk/pull/30092.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/30092/head:pull/30092 PR: https://git.openjdk.org/jdk/pull/30092
On Thu, 5 Mar 2026 17:52:15 GMT, Markus Grönlund <mgronlun@openjdk.org> wrote:
Greetings,
fixing this test as it is racy in two sections:
1. Initialization: Event enabling happens sequentially: 1. SafepointBegin, 2. SafepointStateSynchronization, 3. SafepointEnd. 2. Teardown: The recording is stopped during a safepoint: This will only include 1 and 2 (but not 3).
The test tries to handle 2, but it fails to account for event enabling during initialization. Therefore, the test can end up with three (or more) sets, where only some set "in the middle" is complete. The test fails because it removes the last set, which is correct as it is incomplete, but then expects the first set to be complete, which it might not be because events are enabled serially.
Testing: jdk_jfr
Markus
Marked as reviewed by roberttoyonaga@github.com (no known OpenJDK username). ------------- PR Review: https://git.openjdk.org/jdk/pull/30092#pullrequestreview-3898677545
On Thu, 5 Mar 2026 18:15:10 GMT, Robert Toyonaga <duke@openjdk.org> wrote:
Markus Grönlund has updated the pull request incrementally with one additional commit since the last revision:
cleaner multimap
Marked as reviewed by roberttoyonaga@github.com (no known OpenJDK username).
Thanks @roberttoyonaga and @egahlin for your reviews. ------------- PR Comment: https://git.openjdk.org/jdk/pull/30092#issuecomment-4016248522
Greetings,
fixing this test as it is racy in two sections:
1. Initialization: Event enabling happens sequentially: 1. SafepointBegin, 2. SafepointStateSynchronization, 3. SafepointEnd. 2. Teardown: The recording is stopped during a safepoint: This will only include 1 and 2 (but not 3).
The test tries to handle 2, but it fails to account for event enabling during initialization. Therefore, the test can end up with three (or more) sets, where only some set "in the middle" is complete. The test fails because it removes the last set, which is correct as it is incomplete, but then expects the first set to be complete, which it might not be because events are enabled serially.
Testing: jdk_jfr
Markus
Markus Grönlund has updated the pull request incrementally with one additional commit since the last revision: cleaner multimap ------------- Changes: - all: https://git.openjdk.org/jdk/pull/30092/files - new: https://git.openjdk.org/jdk/pull/30092/files/b0b4a844..8d1fcab9 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=30092&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=30092&range=00-01 Stats: 4 lines in 1 file changed: 0 ins; 2 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/30092.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/30092/head:pull/30092 PR: https://git.openjdk.org/jdk/pull/30092
On Fri, 6 Mar 2026 16:01:58 GMT, Markus Grönlund <mgronlun@openjdk.org> wrote:
Greetings,
fixing this test as it is racy in two sections:
1. Initialization: Event enabling happens sequentially: 1. SafepointBegin, 2. SafepointStateSynchronization, 3. SafepointEnd. 2. Teardown: The recording is stopped during a safepoint: This will only include 1 and 2 (but not 3).
The test tries to handle 2, but it fails to account for event enabling during initialization. Therefore, the test can end up with three (or more) sets, where only some set "in the middle" is complete. The test fails because it removes the last set, which is correct as it is incomplete, but then expects the first set to be complete, which it might not be because events are enabled serially.
Testing: jdk_jfr
Markus
Markus Grönlund has updated the pull request incrementally with one additional commit since the last revision:
cleaner multimap
Marked as reviewed by egahlin (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/30092#pullrequestreview-3908542927
On Thu, 5 Mar 2026 17:52:15 GMT, Markus Grönlund <mgronlun@openjdk.org> wrote:
Greetings,
fixing this test as it is racy in two sections:
1. Initialization: Event enabling happens sequentially: 1. SafepointBegin, 2. SafepointStateSynchronization, 3. SafepointEnd. 2. Teardown: The recording is stopped during a safepoint: This will only include 1 and 2 (but not 3).
The test tries to handle 2, but it fails to account for event enabling during initialization. Therefore, the test can end up with three (or more) sets, where only some set "in the middle" is complete. The test fails because it removes the last set, which is correct as it is incomplete, but then expects the first set to be complete, which it might not be because events are enabled serially.
Testing: jdk_jfr
Markus
This pull request has now been integrated. Changeset: 8ef39a22 Author: Markus Grönlund <mgronlun@openjdk.org> URL: https://git.openjdk.org/jdk/commit/8ef39a22d855d1b1aaeb39549f6e8413f362338b Stats: 37 lines in 1 file changed: 6 ins; 19 del; 12 mod 8374490: Test jdk/jfr/event/runtime/TestSafepointEvents.java failed: Expected event 'jdk.SafepointStateSynchronization' to be present Reviewed-by: egahlin ------------- PR: https://git.openjdk.org/jdk/pull/30092
participants (3)
-
Erik Gahlin
-
Markus Grönlund
-
Robert Toyonaga