Skip to content

Commit

Permalink
8301644: com/sun/jdi/JdbStopThreadTest.java fails after JDK-8300811
Browse files Browse the repository at this point in the history
Reviewed-by: amenkov, kevinw
  • Loading branch information
plummercj committed Feb 2, 2023
1 parent 930ec00 commit de57733
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions test/jdk/com/sun/jdi/JdbStopThreadTest.java
@@ -1,5 +1,5 @@
/*
* Copyright (c) 2018, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2018, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand Down Expand Up @@ -46,6 +46,7 @@ private static void test() {
print(thread); // @1 breakpoint
String str = "test";
print(str); // @2 breakpoint
print("all done"); // @3 breakpoint
}

public static void print(Object obj) {
Expand Down Expand Up @@ -83,8 +84,13 @@ protected void runCases() {
jdb.command(JdbCommand.thread(1));
int bpLine2 = parseBreakpoints(getTestSourcePath("JdbStopThreadTest.java"), 2).get(0);
jdb.command(JdbCommand.stopGoAt(DEBUGGEE_CLASS, bpLine2));
// We need a subsequent breakpoint with SUSPEND_EVENT_THREAD so we don't exit
int bpLine3 = parseBreakpoints(getTestSourcePath("JdbStopThreadTest.java"), 3).get(0);
jdb.command(JdbCommand.stopThreadAt(DEBUGGEE_CLASS, bpLine3));
String pattern2 = PATTERN2_TEMPLATE.replaceAll("%LINE_NUMBER", String.valueOf(bpLine2));
jdb.command(JdbCommand.cont().allowExit());
jdb.command(JdbCommand.cont().waitForPrompt(pattern2, true));
new OutputAnalyzer(jdb.getJdbOutput()).shouldMatch(pattern2);

jdb.quit();
}
}

1 comment on commit de57733

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.