Skip to content

Commit 5de0f4b

Browse files
committedMar 3, 2021
8260869: Test java/foreign/TestHandshake.java fails intermittently
Reviewed-by: psandoz
1 parent c9097a6 commit 5de0f4b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed
 

‎test/jdk/java/foreign/TestHandshake.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,8 @@ public class TestHandshake {
5656
static final int MAX_EXECUTOR_WAIT_SECONDS = 10;
5757
static final int MAX_THREAD_SPIN_WAIT_MILLIS = 200;
5858

59+
static final int NUM_ACCESSORS = Math.min(10, Runtime.getRuntime().availableProcessors());
60+
5961
static final AtomicLong start = new AtomicLong();
6062

6163
@Test(dataProvider = "accessors")
@@ -65,7 +67,7 @@ public void testHandshake(String testName, AccessorFactory accessorFactory) thro
6567
System.out.println("ITERATION " + it);
6668
ExecutorService accessExecutor = Executors.newCachedThreadPool();
6769
start.set(System.currentTimeMillis());
68-
for (int i = 0; i < Runtime.getRuntime().availableProcessors() ; i++) {
70+
for (int i = 0; i < NUM_ACCESSORS ; i++) {
6971
accessExecutor.execute(accessorFactory.make(i, segment));
7072
}
7173
int delay = ThreadLocalRandom.current().nextInt(MAX_DELAY_MILLIS);

0 commit comments

Comments
 (0)