changeset 57114:2081ff900d65

8227235: rare failures in testForkHelpQuiesce tck tests Reviewed-by: martin, alanb
author dl
date Sat, 14 Sep 2019 11:20:57 -0700
parents 51cd29502ea9
children f689a48dba4b
files test/jdk/java/util/concurrent/tck/ForkJoinTask8Test.java test/jdk/java/util/concurrent/tck/ForkJoinTaskTest.java
diffstat 2 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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);