RFR(XS) 8220030: JdbStopThreadidTest.java failed due to "Unexpected IO error while writing command 'quit' to jdb stdin stream"

Chris Plummer chris.plummer at oracle.com
Tue Mar 5 03:41:51 UTC 2019


Hello,

Please review the following. Details are in the bug. In short, the way I 
was checking for the application exit was a bit non-standard and exposed 
what is probably a bug in the JdbTest shutdown code. I changed the test 
to conform to the way other test run to exit:

https://bugs.openjdk.java.net/browse/JDK-8220030

diff --git a/test/jdk/com/sun/jdi/JdbStopThreadidTest.java 
b/test/jdk/com/sun/jdi/JdbStopThreadidTest.java
--- a/test/jdk/com/sun/jdi/JdbStopThreadidTest.java
+++ b/test/jdk/com/sun/jdi/JdbStopThreadidTest.java
@@ -32,6 +32,7 @@
   * @run main/othervm JdbStopThreadidTest
   */

+import jdk.test.lib.process.OutputAnalyzer;
  import lib.jdb.Jdb;
  import lib.jdb.JdbCommand;
  import lib.jdb.JdbTest;
@@ -138,6 +139,7 @@
          jdb.command(JdbCommand.cont().waitForPrompt("Breakpoint hit: 
\"thread=MYTHREAD-2\", \\S+MyThread.brkMethod", true));
          // Continue until the application exits. Once again, hitting a 
breakpoint will cause
          // a failure because we are not suppose to hit one.
- jdb.command(JdbCommand.cont().waitForPrompt(Jdb.APPLICATION_EXIT, true));
+        jdb.contToExit(1);
+        new 
OutputAnalyzer(getJdbOutput()).shouldContain(Jdb.APPLICATION_EXIT);

thanks,

Chris




More information about the serviceability-dev mailing list