Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8287165: JFR: Add logging to jdk/jfr/api/consumer/recordingstream/TestOnEvent.java #8847

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion test/jdk/ProblemList.txt
Original file line number Diff line number Diff line change
@@ -763,7 +763,6 @@ jdk/jfr/event/compiler/TestCodeSweeper.java 8225209 generic-
jdk/jfr/event/os/TestThreadContextSwitches.java 8247776 windows-all
jdk/jfr/startupargs/TestStartName.java 8214685 windows-x64
jdk/jfr/startupargs/TestStartDuration.java 8214685 windows-x64
jdk/jfr/api/consumer/recordingstream/TestOnEvent.java 8255404 linux-x64
jdk/jfr/jvm/TestWaste.java 8282427 generic-all

############################################################################
Original file line number Diff line number Diff line change
@@ -149,25 +149,33 @@ private static void testOnEvent() throws Exception {
}

private static void testOnEventAfterStart() {
log("Entering testOnEventAfterStart()");
try (RecordingStream r = new RecordingStream()) {
EventProducer p = new EventProducer();
p.start();
Thread addHandler = new Thread(() -> {
r.onEvent(e -> {
// Got event, close stream
log("Executing onEvent");
r.close();
log("RecordingStream closed");
});
});
r.onFlush(() -> {
// Only add handler once
if (!"started".equals(addHandler.getName())) {
addHandler.setName("started");
log("About to start addHandler thread");
addHandler.start();
}
});
log("About to start RecordingStream");
r.start();
log("About to kill EventProducer");
p.kill();
log("EventProducer killed");
}
log("Leaving testOnEventAfterStart()");
}

// Starts recording stream and ensures stream