Skip to content

Commit 4a338c6

Browse files
committed
[Linux] Fix random test failures of browser tests #1523
Browser tests randomly fail during Jenkins execution because of too many opened file descriptors. The reason seems to be that the build uses parallel execution and Maven plugins executed for other bundles may have opened and closed file descriptors in parallel, which are erroneously taken into account by the browser tests evaluating the number of file descriptors left open after a test execution. This change excludes open file descriptors for Maven artifacts used in parallel by other Maven plugins by not considering file descriptors with their path containing ".m2". Fixes #1523
1 parent cfbd282 commit 4a338c6

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

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

+7-1
Original file line numberDiff line numberDiff line change
@@ -2846,7 +2846,13 @@ private static List<String> getOpenedDescriptors() {
28462846
try(DirectoryStream<Path> directoryStream = Files.newDirectoryStream(fd)){
28472847
directoryStream.forEach(f -> {
28482848
try {
2849-
paths.add(Files.isSymbolicLink(f)? Files.readSymbolicLink(f).toString() : f.toString());
2849+
// Do not consider file descriptors of Maven artifacts that are currently opened
2850+
// by other Maven plugins executed in parallel build (such as parallel
2851+
// compilation of the swt.tools bundle etc.)
2852+
String resolvedPath = Files.isSymbolicLink(f) ? Files.readSymbolicLink(f).toString() : f.toString();
2853+
if (!resolvedPath.contains(".m2")) {
2854+
paths.add(resolvedPath);
2855+
}
28502856
} catch (IOException e) {
28512857
e.printStackTrace();
28522858
}

0 commit comments

Comments
 (0)