Skip to content

Commit c785da1

Browse files
committed
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 that long 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. Since the first Edge browser instantiation takes rather long at least in the GitHub actions test environment, that instantiation is isolated in an execution before the test class. Related to #1676
1 parent f2b3f97 commit c785da1

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

tests/org.eclipse.swt.tests/JUnit Tests/org/eclipse/swt/tests/junit/Test_org_eclipse_swt_browser_Browser.java

+2-3
Original file line numberDiff line numberDiff line change
@@ -102,16 +102,15 @@
102102
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
103103
public class Test_org_eclipse_swt_browser_Browser extends Test_org_eclipse_swt_widgets_Composite {
104104

105-
// TODO Reduce to reasonable value
106-
private static Duration MAXIMUM_BROWSER_CREATION_TIME = Duration.ofSeconds(90);
105+
private static Duration MAXIMUM_BROWSER_CREATION_TIME = Duration.ofSeconds(10);
107106

108107
static {
109108
try {
110109
printSystemEnv();
111110
} catch (Exception e) {
112111
e.printStackTrace();
113112
}
114-
System.setProperty("org.eclipse.swt.internal.win32.Edge.timeout", Long.toString(MAXIMUM_BROWSER_CREATION_TIME.toMillis()));
113+
System.setProperty("org.eclipse.swt.internal.win32.Edge.timeout", Long.toString(Duration.ofSeconds(90).toMillis()));
115114
}
116115

117116
// CONFIG

0 commit comments

Comments
 (0)