diff options
author | 2023-01-05 12:53:25 +0000 | |
---|---|---|
committer | 2023-01-09 09:58:08 +0000 | |
commit | 81c75f4363894cd39b5cb32492a03de6a6469271 (patch) | |
tree | e93a9ab43116563871fd5dbcb34d376825178ac3 /test/168-vmstack-annotated | |
parent | 8e41b1247ffb30f175879a975435c263ff4e56af (diff) |
De-flake 168-vmstack-annotated.
The test is brittle in that it expects the thread to enter the
non-runnable state at a precise location. The ForkJoinPool class
initializer was breaking this assumption, so eagerly initialize the
class.
Test: 168-vmstack-annotated
Bug: 262209436
Change-Id: I70c45c6e71de6e93aa994f3edeaf7ea6667c0536
Diffstat (limited to 'test/168-vmstack-annotated')
-rw-r--r-- | test/168-vmstack-annotated/src/Main.java | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/168-vmstack-annotated/src/Main.java b/test/168-vmstack-annotated/src/Main.java index 8234f945c0..5056c42759 100644 --- a/test/168-vmstack-annotated/src/Main.java +++ b/test/168-vmstack-annotated/src/Main.java @@ -22,6 +22,7 @@ import java.util.List; import java.util.Map; import java.util.concurrent.BrokenBarrierException; import java.util.concurrent.CyclicBarrier; +import java.util.concurrent.ForkJoinPool; public class Main { @@ -89,6 +90,9 @@ public class Main { } public static void main(String[] args) throws Exception { + // Eagerly initialize ForkJoinPool as we've seen the class initialization code interfere + // with the logic of the test when waiting for threads to be non-runnable. + Class.forName(ForkJoinPool.class.getName(), true, ForkJoinPool.class.getClassLoader()); try { testCluster1(); } catch (Exception e) { |