Skip to content
This repository has been archived by the owner. It is now read-only.
Permalink
Browse files
8260869: Test java/foreign/TestHandshake.java fails intermittently
Reviewed-by: psandoz
  • Loading branch information
mcimadamore committed Mar 3, 2021
1 parent c9097a6 commit 5de0f4b2ce5bcb02dc935c09a4a72ef63eadc6e3
Showing with 3 additions and 1 deletion.
  1. +3 −1 test/jdk/java/foreign/TestHandshake.java
@@ -56,6 +56,8 @@ public class TestHandshake {
static final int MAX_EXECUTOR_WAIT_SECONDS = 10;
static final int MAX_THREAD_SPIN_WAIT_MILLIS = 200;

static final int NUM_ACCESSORS = Math.min(10, Runtime.getRuntime().availableProcessors());

static final AtomicLong start = new AtomicLong();

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

0 comments on commit 5de0f4b

Please sign in to comment.