1818package org .newsclub .net .unix .domain ;
1919
2020import static org .junit .jupiter .api .Assertions .assertTrue ;
21- import static org .junit .jupiter .api .Assumptions .assumeTrue ;
2221
2322import java .io .BufferedReader ;
2423import java .io .InputStreamReader ;
4039
4140import com .kohlschutter .testutil .ForkedVM ;
4241import com .kohlschutter .testutil .ForkedVMRequirement ;
42+ import com .kohlschutter .testutil .TestAbortedNotAnIssueException ;
4343
4444/**
4545 * Ensures dependent virtual-thread socket reads can complete when the common pool has a single
@@ -52,7 +52,9 @@ public class VirtualThreadPollerNaiveDeadlockTest {
5252 @ Test
5353 @ ForkedVMRequirement (forkSupported = true )
5454 public void testWithParallelism1 () throws Exception {
55- assumeTrue (ThreadUtil .isVirtualThreadSupported ());
55+ if (!ThreadUtil .isVirtualThreadSupported ()) {
56+ throw new TestAbortedNotAnIssueException ("Virtual threads not supported" );
57+ }
5658
5759 if (ThreadUtil .commonPool ().getParallelism () == 1 ) {
5860 // no need to fork
@@ -117,9 +119,13 @@ public static void main(String[] args) throws Exception {
117119 }
118120
119121 private static void reproduce () throws Exception { // NOPMD.CognitiveComplexity
120- assumeTrue (ThreadUtil .isVirtualThreadSupported ());
121- assumeTrue (ThreadUtil .commonPool ().getParallelism () == 1 ,
122- "Test requires -Djava.util.concurrent.ForkJoinPool.common.parallelism=1" );
122+ if (!ThreadUtil .isVirtualThreadSupported ()) {
123+ throw new TestAbortedNotAnIssueException ("Virtual threads not supported" );
124+ }
125+ if (ThreadUtil .commonPool ().getParallelism () == 1 ) {
126+ throw new TestAbortedNotAnIssueException (
127+ "Test requires -Djava.util.concurrent.ForkJoinPool.common.parallelism=1" );
128+ }
123129
124130 Path socketPath = Files .createTempFile ("junixsocket-vtpoll-deadlock-" , ".sock" );
125131 Files .deleteIfExists (socketPath );
0 commit comments