Skip to content

Commit 1bb037b

Browse files
committed
8309329: com/sun/jdi/DeferredStepTest.java fails with virtual threads due to not waiting for threads to exit
Reviewed-by: sspitsyn, lmesnik, amenkov
1 parent a23bbea commit 1bb037b

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

test/jdk/ProblemList-Virtual.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ com/sun/jdi/EATests.java#id0 8264699 generic-
2727
## Tests failing when main() is executed in additional vthread or in vthread instead of thread
2828
#
2929

30-
com/sun/jdi/DeferredStepTest.java 8285422 generic-all
3130
com/sun/jdi/ExceptionEvents.java 8285422 generic-all
3231
com/sun/jdi/JdbMethodExitTest.java 8285422 generic-all
3332
com/sun/jdi/JdbStepTest.java 8285422 generic-all

test/jdk/com/sun/jdi/DeferredStepTest.java

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,17 @@ public static void main(String argv[]) {
7474

7575
jj1 obj1 = new jj1();
7676
jj2 obj2 = new jj2();
77-
TestScaffold.newThread(obj1, "jj1").start();
78-
TestScaffold.newThread(obj2, "jj2").start();
77+
Thread thread1 = TestScaffold.newThread(obj1, "jj1");
78+
Thread thread2 = TestScaffold.newThread(obj2, "jj2");
79+
thread1.start();
80+
thread2.start();
81+
// Threads might be deamon threads, so wait here for them to complete.
82+
try {
83+
thread1.join();
84+
thread2.join();
85+
} catch (InterruptedException ie) {
86+
throw new RuntimeException(ie);
87+
}
7988
}
8089
}
8190

0 commit comments

Comments
 (0)