changeset 54003:f3468c1bdf5f

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
author cjplummer
date Tue, 05 Mar 2019 13:40:05 -0800
parents fb9541185457
children 465beebb1071
files test/jdk/com/sun/jdi/JdbStopThreadidTest.java
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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);
     }
 }