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

2019-03-05 Thread Alex Menkov

LGTM too.

--alex

On 03/05/2019 04:47, Gary Adams wrote:

This looks OK to me.

If a specific return code is expected,
then the test should wait until it gets the response it needs.

If a specific return is not required, the test should be lenient
about what information is required for the test to complete.

On 3/4/19, 10:41 PM, Chris Plummer wrote:

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






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

2019-03-05 Thread Gary Adams

This looks OK to me.

If a specific return code is expected,
then the test should wait until it gets the response it needs.

If a specific return is not required, the test should be lenient
about what information is required for the test to complete.

On 3/4/19, 10:41 PM, Chris Plummer wrote:

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






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

2019-03-04 Thread Chris Plummer

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