Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -37,6 +38,11 @@ public class Test_org_eclipse_swt_custom_BusyIndicator {
@Test
@Timeout(value = 30)
public void testShowWhile() {
if (SwtTestUtil.isLinux) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sound completely off, why should the number of CPU core matter?!? Java can have 100 of parallel threads on a single CPU...

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you have a better idea why the test hangs?
Let try that please. I'm tired to see the test failing every second day.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So I do not have a theory here, but as I'm not aware it fails since its creation in Jun 23, 2024 it might be a bug/regression in GTK part of Linux.

Test is not really complex and the assumption it is in any way related to the number of CPUs does not hold true. Also why should it only fail on Linux then?

As you already noticed it even succeed on Hardware with less course, so any arbitrary number here will simply disable the test and hiding a possible bug.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #3051

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();
Expand Down
Loading