8227235: rare failures in testForkHelpQuiesce tck tests
authordl
Sat, 14 Sep 2019 11:20:57 -0700
changeset 58135 2081ff900d65
parent 58134 51cd29502ea9
child 58136 f689a48dba4b
8227235: rare failures in testForkHelpQuiesce tck tests Reviewed-by: martin, alanb
test/jdk/java/util/concurrent/tck/ForkJoinTask8Test.java
test/jdk/java/util/concurrent/tck/ForkJoinTaskTest.java
--- a/test/jdk/java/util/concurrent/tck/ForkJoinTask8Test.java	Sat Sep 14 11:16:40 2019 -0700
+++ b/test/jdk/java/util/concurrent/tck/ForkJoinTask8Test.java	Sat Sep 14 11:20:57 2019 -0700
@@ -559,6 +559,8 @@
                 AsyncFib f = new AsyncFib(8);
                 assertSame(f, f.fork());
                 helpQuiesce();
+                while (!f.isDone()) // wait out race
+                    ;
                 assertEquals(0, getQueuedTaskCount());
                 f.checkCompletedNormally();
             }};
--- a/test/jdk/java/util/concurrent/tck/ForkJoinTaskTest.java	Sat Sep 14 11:16:40 2019 -0700
+++ b/test/jdk/java/util/concurrent/tck/ForkJoinTaskTest.java	Sat Sep 14 11:20:57 2019 -0700
@@ -526,6 +526,8 @@
                 AsyncFib f = new AsyncFib(8);
                 assertSame(f, f.fork());
                 helpQuiesce();
+                while (!f.isDone()) // wait out race
+                    ;
                 assertEquals(21, f.number);
                 assertEquals(0, getQueuedTaskCount());
                 checkCompletedNormally(f);