Patch attached.
On 9/20/18, 8:17 PM, Chris Plummer wrote:
Ok, so you're just suggesting that findPrompt() should require that
the prompt be at the end of the line. In fact probably on a line by
itself. Keep in mind that we also have issues with async printing that
tends to result in the prompt appearing in the middle of some lines.
We have most of these situations understood and under control now, but
I'm guessing they still turn up in some places, and would cause
findPrompt() to fail.
Chris
On 9/20/18 4:06 PM, Alex Menkov wrote:
To be detected the output line should ends with "Boolean[1] "
So "Field (nsk.jdb.unwatch.unwatch002.unwatch002a.FS1) is null, will
be instance of java.lang.Boolean[1] (id=706):" does not match.
It seems to me that other bugs Gary is working have similar cases.
--alex
On 09/20/2018 15:27, Chris Plummer wrote:
The regex you give would still detect Boolean[1] as a prompt, which
we don't want.
Chris
On 9/20/18 3:22 PM, Alex Menkov wrote:
May be it would be better to fix Jdb.receiveReplyFor to properly
handle all replies like
Field (nsk.jdb.unwatch.unwatch002.unwatch002a.FS1) is null, will be
instance of java.lang.Boolean[1] (id=706):
jdk/com/sun/jdi tests use the following regexp to detect jdb prompt:
"[a-zA-Z0-9_-][a-zA-Z0-9_-]*\[[1-9][0-9]*\] [ >]*$"
(see test/jdk/com/sun/jdi/lib/jdb/Jdb.java or
test/jdk/com/sun/jdi/ShellScaffold.sh)
AFAIR nsk/../Jdb does not use regexp, but I believe it can be
updated to work the same way.
--alex
On 09/20/2018 14:50, Chris Plummer wrote:
This one is a little different than exclude001 in that we don't
control the name of the thread. We know (at least at the moment)
that it is called "main", but that could always change. In general
I'm fine with this fix, but if you have others like it, I'd
suggest putting the "main" thread name in single place, not in
each test that cares about it.
Chris
On 9/20/18 10:54 AM, Gary Adams wrote:
The corrupted output has been identified due to the "Boolean[1]"
being misrecognized as a compound prompt.
The proposed fix waits for the correct prompt before
advancing to the next command.
Webrev: http://cr.openjdk.java.net/~gadams/8208471/webrev/
Issue: https://bugs.openjdk.java.net/browse/JDK-8208471
Testing is in progress.
# HG changeset patch
# User gadams
# Date 1537532035 14400
# Fri Sep 21 08:13:55 2018 -0400
# Node ID c0fc6897a794f9f1fd0b6ff466e62327b8dbc3c4
# Parent 75e4ce0fa1baef05027d2e4069cffb1930edb92f
8208471: nsk/jdb/unwatch/unwatch002/unwatch002.java fails with "Prompt is not
received during 300200 milliseconds"
Reviewed-by: cjplummer, amenkov
diff --git
a/test/hotspot/jtreg/vmTestbase/nsk/jdb/unwatch/unwatch002/unwatch002.java
b/test/hotspot/jtreg/vmTestbase/nsk/jdb/unwatch/unwatch002/unwatch002.java
--- a/test/hotspot/jtreg/vmTestbase/nsk/jdb/unwatch/unwatch002/unwatch002.java
+++ b/test/hotspot/jtreg/vmTestbase/nsk/jdb/unwatch/unwatch002/unwatch002.java
@@ -91,6 +91,7 @@
static final String DEBUGGEE_CLASS2 = DEBUGGEE_CLASS + "$CheckedFields";
static final String FIRST_BREAK = DEBUGGEE_CLASS + ".main";
static final String LAST_BREAK = DEBUGGEE_CLASS + ".breakHere";
+ static final String expectedPrompt = "main[1]";
static String[] checkedFields = { "FS1" };
static String[] checkedFields2 = { "FT1", "FV1" };
@@ -113,7 +114,7 @@
// jdb.contToExit((checkedFields.length *2) + (checkedFields2.length
*2) + 2);
for (int i = 0; i < (checkedFields.length *2 + checkedFields2.length*2
+ 2); i++) {
- reply = jdb.receiveReplyFor(JdbCommand.cont);
+ reply = jdb.receiveReplyForWithMessageWait(JdbCommand.cont,
expectedPrompt);
}
unwatchFields (DEBUGGEE_CLASS, checkedFields);