8331999: BasicDirectoryModel/LoaderThreadCount.java frequently fails on Windows in CI

Introduce tolerance factor: count > loaderCount.size() / 2
Fail the test only if the number of snapshots with more than
2 file loader threads is greater than half of the number
of valid snapshots.

Reviewed-by: prr, honkar
This commit is contained in:
Alexey Ivanov 2024-05-09 18:01:27 +00:00
parent c7d98df2ac
commit ffbdfffbc7

@ -164,7 +164,7 @@ public final class LoaderThreadCount extends ThreadGroup {
System.out.println(" = 1: " + ones);
System.out.println(" = 2: " + twos);
System.out.println(" > 2: " + count);
if (count > 0) {
if (count > loaderCount.size() / 2) {
throw new RuntimeException("Detected " + count + " snapshots "
+ "with several loading threads");
}