mirror of
https://github.com/openjdk/jdk.git
synced 2026-03-15 02:13:19 +00:00
8260869: Test java/foreign/TestHandshake.java fails intermittently
Reviewed-by: psandoz
This commit is contained in:
parent
c9097a60b6
commit
5de0f4b2ce
@ -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 class TestHandshake {
|
||||
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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user