From 228c11e1a7a92b0d7b2a3f2df5f885b3020e99c1 Mon Sep 17 00:00:00 2001 From: Heiko Klare Date: Mon, 6 Jan 2025 14:47:42 +0100 Subject: [PATCH] Browser tests: reduce timeout for instantiation to reasonable value The timeout for browser instantiation in the browser tests has been increased to avoid flaky tests. However, browser instantiation taking more than 10 seconds (the previous timeout value) is an indicator for something being wrong with the instantiation. There is no reason why instantiation may take that long during test execution but the same issue should never arise in productive use, thus such a case should be captured by tests and, if necessary, be fixed productively. In order to do so, this change reduces the test timeout value again to a more reasonable value. Related to https://github.com/eclipse-platform/eclipse.platform.swt/issues/1676 --- .../swt/tests/junit/Test_org_eclipse_swt_browser_Browser.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_browser_Browser.java b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_browser_Browser.java index f76da4c2d7..567bcb3e38 100644 --- a/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_browser_Browser.java +++ b/tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_browser_Browser.java @@ -163,7 +163,7 @@ public static void setupEdgeEnvironment() { // initialize Edge environment before any test runs to isolate environment setup if (SwtTestUtil.isWindows) { Shell shell = new Shell(); - new Browser(shell, SWT.EDGE); + new Browser(shell, SWT.EDGE).getUrl(); shell.dispose(); } } @@ -302,7 +302,7 @@ private int reportOpenedDescriptors() { } private Browser createBrowser(Shell s, int flags) { - long maximumBrowserCreationMilliseconds = 90_000; + long maximumBrowserCreationMilliseconds = 15_000; long createStartTime = System.currentTimeMillis(); Browser b = new Browser(s, flags); // Wait for asynchronous initialization via getting URL