mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-24 13:04:33 +02:00
7057320: test/java/util/concurrent/Executors/AutoShutdown.java failing intermittently
Add retry/timeout for checking activeCount Reviewed-by: chegar
This commit is contained in:
parent
e3c0616ac7
commit
517763ddf1
1 changed files with 5 additions and 0 deletions
|
@ -67,6 +67,11 @@ public class AutoShutdown {
|
|||
e1 = e2 = null;
|
||||
for (int i = 0; i < 10 && Thread.activeCount() > count0; i++)
|
||||
tryWaitForFinalizersToRun();
|
||||
for (int i = 0; i < 10; ++i) { // give JVM a chance to settle.
|
||||
if (Thread.activeCount() == count0)
|
||||
return;
|
||||
Thread.sleep(1000);
|
||||
}
|
||||
equal(Thread.activeCount(), count0);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue