Skip to content

8361370: runtime/Thread/TestThreadDumpMonitorContention.java fails due to time out on Windows #26895

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
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
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ public class TestThreadDumpMonitorContention {
// getJDKTool() which can fall back to "compile.jdk".
final static String JSTACK = JDKToolFinder.getTestJDKTool("jstack");
final static String PID = Long.toString(ProcessHandle.current().pid());
// jstack streming output should be disabled because if the attach operation is executed at a safepoint,
// the attach streaming output is enabled and the tool output is lengthy we can get both buffers (the attach
// channel and the tool redirection buffer) full and the test hangs.
// Instead the attach operation output is buffered and is sent after the operation is completed
final static String DISABLE_STREAMING_OUTPUT = "-J-Djdk.attach.allowStreamingOutput=false";

// looking for header lines with these patterns:
// "ContendingThread-1" #19 prio=5 os_prio=64 tid=0x000000000079c000 nid=0x23 runnable [0xffff80ffb8b87000]
Expand Down Expand Up @@ -379,7 +384,7 @@ static void doSamples() throws Exception {
// we don't mix data between the two stack traces that do
// match HEADER_PREFIX_PATTERN.
//
Process process = new ProcessBuilder(JSTACK, PID)
Process process = new ProcessBuilder(JSTACK, DISABLE_STREAMING_OUTPUT, PID)
.redirectErrorStream(true).start();

BufferedReader reader = new BufferedReader(new InputStreamReader(
Expand Down