8220030: JdbStopThreadidTest.java failed due to "Unexpected IO error while writing command 'quit' to jdb stdin stream"
authorcjplummer
Tue, 05 Mar 2019 13:40:05 -0800
changeset 54003 f3468c1bdf5f
parent 54002 fb9541185457
child 54004 465beebb1071
8220030: JdbStopThreadidTest.java failed due to "Unexpected IO error while writing command 'quit' to jdb stdin stream" Summary: Use contToExit(1) for safer approach to test exit. Reviewed-by: gadams, amenkov
test/jdk/com/sun/jdi/JdbStopThreadidTest.java
--- a/test/jdk/com/sun/jdi/JdbStopThreadidTest.java	Tue Mar 05 10:35:29 2019 -0800
+++ b/test/jdk/com/sun/jdi/JdbStopThreadidTest.java	Tue Mar 05 13:40:05 2019 -0800
@@ -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);
     }
 }