After JDK-8331142 was integrated, the test/jdk/javax/swing/plaf/basic/BasicDirectoryModel/LoaderThreadCount.java test frequently fails on Windows in CI.
All the failures found on Windows look the same:
Number of snapshots: 20
Number of snapshots where number of loader threads:
= 1: 19
= 2: 0
> 2: 1
Exception in Test Runner: class java.lang.RuntimeException: Detected 1 snapshots with several loading threads
java.lang.RuntimeException: Detected 1 snapshots with several loading threads
at LoaderThreadCount.runTest(LoaderThreadCount.java:168)
at LoaderThreadCount.wrapper(LoaderThreadCount.java:108)
at java.base/java.lang.Thread.run(Thread.java:1575)
A kind of tolerance is needed. For example, fail the test if the number of snapshots with more than 2 loading threads is above 2 or 3. Without the fix, the number of such snapshots is much higher, usually at 20 out of 20, the lowest I've seen over the recent days is 16.
A fraction of the number of (valid) snapshots could be used, for instance SNAPSHOTS / 2 or loaderCount.size() / 2, both usually give 10 on Windows.