Skip to content

Commit

Permalink
8285416: [LOOM] Some nsk/jdi tests fail due to needing too many virtu…
Browse files Browse the repository at this point in the history
…al threads

8282383: [LOOM] 6 nsk JDI and JDB tests sometimes failing with vthread wrapper due to running out of carrier threads

Reviewed-by: dholmes, sspitsyn, alanb, lmesnik
  • Loading branch information
plummercj committed Jan 6, 2023
1 parent ba03f42 commit d6e9f01
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 25 deletions.
23 changes: 0 additions & 23 deletions test/hotspot/jtreg/ProblemList-svc-vthread.txt
Original file line number Diff line number Diff line change
Expand Up @@ -131,29 +131,6 @@ vmTestbase/nsk/jdi/ThreadReference/forceEarlyReturn/forceEarlyReturn014/forceEar
vmTestbase/nsk/jdi/stress/serial/forceEarlyReturn001/TestDescription.java 8285415 generic-all
vmTestbase/nsk/jdi/stress/serial/forceEarlyReturn002/TestDescription.java 8285415 generic-all

###
# These 2 tests try to create 10 vthreads and have them all block on a synchronized
# method call, but on some hosts there are not enough carrier threads to support pinning
# all 10 vthreads, so the test deadlocks. -Djdk.defaultScheduler.parallelism=<n>
# could be used with the debuggee to ensure there are enough carrier threads.

vmTestbase/nsk/jdi/EventRequestManager/stepRequests/stepreq002/TestDescription.java 8285416 generic-all
vmTestbase/nsk/jdi/EventRequestManager/deleteEventRequests/delevtreqs002/TestDescription.java 8285416 generic-all

###
# These tests all create 5 virtual threads that block on a synchronized block, which causes
# them to pin the carrier therad. On some of the macOS hosts there are only 4 cores,
# so by default you only get 4 carrier threads. When this happesn the test is unable to get all
# of the virtual threads started, and ends up timing out. -Djdk.defaultScheduler.parallelism=<n>
# could be used with the debuggee to ensure there are enough carrier threads.

vmTestbase/nsk/jdb/kill/kill001/kill001.java 8282383 macosx-x64
vmTestbase/nsk/jdi/LocatableEvent/thread/thread001/TestDescription.java 8282383 macosx-x64
vmTestbase/nsk/jdi/Event/request/request001/TestDescription.java 8282383 macosx-x64
vmTestbase/nsk/jdi/EventIterator/nextEvent/nextevent001/TestDescription.java 8282383 macosx-x64
vmTestbase/nsk/jdi/EventRequestManager/stepRequests/stepreq001/TestDescription.java 8282383 macosx-x64
vmTestbase/nsk/jdi/ObjectReference/waitingThreads/waitingthreads002/TestDescription.java 8282383 macosx-x64

###
# This test always times out on windows. This is due to the test forcing OOME in the
# debuggee, which has the side affect of making the Read-Poller thread exit. Because
Expand Down
4 changes: 3 additions & 1 deletion test/hotspot/jtreg/vmTestbase/nsk/share/jdb/Launcher.java
Original file line number Diff line number Diff line change
Expand Up @@ -163,10 +163,12 @@ private String[] makeJdbCmdLine (String classToExecute) {
args.add(jdbExecPath.trim());

if (argumentHandler.isLaunchingConnector()) {
/* Need --enable-preview on the debuggee in order to support virtual threads. */
boolean vthreadMode = "Virtual".equals(System.getProperty("main.wrapper"));
if (vthreadMode) {
/* Need --enable-preview on the debuggee in order to support virtual threads. */
args.add("-R--enable-preview");
/* Some tests need more carrier threads than the default provided. */
args.add("-R-Djdk.virtualThreadScheduler.parallelism=15");
}
}

Expand Down
4 changes: 3 additions & 1 deletion test/hotspot/jtreg/vmTestbase/nsk/share/jdi/Binder.java
Original file line number Diff line number Diff line change
Expand Up @@ -751,10 +751,12 @@ private Map<String,? extends Argument> setupLaunchingConnector(LaunchingConnecto
vmArgs = vmUserArgs;
}

/* Need --enable-preview on the debuggee in order to support virtual threads. */
boolean vthreadMode = "Virtual".equals(System.getProperty("main.wrapper"));
if (vthreadMode) {
/* Need --enable-preview on the debuggee in order to support virtual threads. */
vmArgs += " --enable-preview";
/* Some tests need more carrier threads than the default provided. */
vmArgs += " -Djdk.virtualThreadScheduler.parallelism=15";
}

/*
Expand Down

1 comment on commit d6e9f01

@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.