From ffbdfffbc702253f32fa45dc1855b663c72074a6 Mon Sep 17 00:00:00 2001 From: Alexey Ivanov Date: Thu, 9 May 2024 18:01:27 +0000 Subject: [PATCH] 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 --- .../swing/plaf/basic/BasicDirectoryModel/LoaderThreadCount.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/jdk/javax/swing/plaf/basic/BasicDirectoryModel/LoaderThreadCount.java b/test/jdk/javax/swing/plaf/basic/BasicDirectoryModel/LoaderThreadCount.java index 689aca5bbdb..770c8f92b26 100644 --- a/test/jdk/javax/swing/plaf/basic/BasicDirectoryModel/LoaderThreadCount.java +++ b/test/jdk/javax/swing/plaf/basic/BasicDirectoryModel/LoaderThreadCount.java @@ -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"); }