From 444bb48ab5cae173f12e7cb32a750c9966770b12 Mon Sep 17 00:00:00 2001 From: Andrey Loskutov Date: Tue, 3 Feb 2026 17:27:17 +0100 Subject: [PATCH] Assume minimal CPU configuration for the BusyIndicator test on Linux The test never fail locally with 32 cores, fails every second time on smaller VM configs. Let assume at least 4 cores on Linux. See https://github.com/eclipse-platform/eclipse.platform.swt/issues/3044 --- .../junit/Test_org_eclipse_swt_custom_BusyIndicator.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_BusyIndicator.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_BusyIndicator.java index 2add7920c7..8c83d477ca 100644 --- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_BusyIndicator.java +++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_custom_BusyIndicator.java @@ -16,6 +16,7 @@ import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertNotEquals; import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assumptions.assumeTrue; import java.util.concurrent.CompletableFuture; import java.util.concurrent.CountDownLatch; @@ -37,6 +38,11 @@ public class Test_org_eclipse_swt_custom_BusyIndicator { @Test @Timeout(value = 30) public void testShowWhile() { + if (SwtTestUtil.isLinux) { + int availableProcessors = Runtime.getRuntime().availableProcessors(); + assumeTrue(availableProcessors >= 4, + "Need at least 4 CPUs for this test to be reliable on Linux: " + availableProcessors); + } // Executors.newSingleThreadExecutor() hangs on some Linux configurations try (ExecutorService executor = Executors.newFixedThreadPool(2)){ Shell shell = new Shell();