Skip to content

Commit a6a2063

Browse files
HeikoKlareakurtakov
authored andcommitted
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 8c93758 commit a6a2063

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,16 +105,15 @@
105105
@FixMethodOrder(MethodSorters.NAME_ASCENDING)
106106
public class Test_org_eclipse_swt_browser_Browser extends Test_org_eclipse_swt_widgets_Composite {
107107

108-
// TODO Reduce to reasonable value
109-
private static Duration MAXIMUM_BROWSER_CREATION_TIME = Duration.ofSeconds(90);
108+
private static Duration MAXIMUM_BROWSER_CREATION_TIME = Duration.ofSeconds(10);
110109

111110
static {
112111
try {
113112
printSystemEnv();
114113
} catch (Exception e) {
115114
e.printStackTrace();
116115
}
117-
System.setProperty("org.eclipse.swt.internal.win32.Edge.timeout", Long.toString(MAXIMUM_BROWSER_CREATION_TIME.toMillis()));
116+
System.setProperty("org.eclipse.swt.internal.win32.Edge.timeout", Long.toString(Duration.ofSeconds(90).toMillis()));
118117
}
119118

120119
// CONFIG

0 commit comments

Comments
 (0)