Skip to content

Commit

Permalink
8338469: com/sun/jdi/DataDumpTest.java failed with Not a debuggee, or…
Browse files Browse the repository at this point in the history
… not listening for debugger to attach

Reviewed-by: dcubed
  • Loading branch information
plummercj committed Aug 16, 2024
1 parent 961e944 commit 8635642
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions test/jdk/com/sun/jdi/DataDumpTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,11 @@ private static void runTest(String jdwpArg) throws Exception {
try {
p = pb.start();
InputStream is = p.getInputStream();

// Read the first character of output to make sure we've waited until the
// debuggee is ready. This will be the debug agent's "Listening..." message.
char firstChar = (char)is.read();

out = new OutputAnalyzer(p);

// Attach a debugger and do the data dump. The data dump output will appear
Expand All @@ -92,8 +97,8 @@ private static void runTest(String jdwpArg) throws Exception {

out.waitFor(); // Wait for the debuggee to exit

System.out.println("Deuggee output:");
System.out.println(out.getOutput());
System.out.println("Debuggee output:");
System.out.println(firstChar + out.getOutput());

// All these strings are part of the debug agent data dump output.
out.shouldHaveExitValue(0);
Expand Down

0 comments on commit 8635642

Please sign in to comment.