File tree Expand file tree Collapse file tree 2 files changed +14
-0
lines changed
libs/plugin-scanner/src/test/java/org/elasticsearch/plugin/scanner Expand file tree Collapse file tree 2 files changed +14
-0
lines changed Original file line number Diff line number Diff line change 88
99package org .elasticsearch .plugin .scanner ;
1010
11+ import org .elasticsearch .core .IOUtils ;
1112import org .elasticsearch .test .ESTestCase ;
1213import org .elasticsearch .test .compiler .InMemoryJavaCompiler ;
1314import org .elasticsearch .test .jar .JarUtils ;
@@ -39,6 +40,9 @@ public void testModuleInfoIsNotReturnedAsAClassFromJar() throws IOException {
3940
4041 List <ClassReader > classReaders = ClassReaders .ofPaths (Stream .of (jar ));
4142 org .hamcrest .MatcherAssert .assertThat (classReaders , Matchers .empty ());
43+
44+ // aggressively delete the jar dir, so that any leaked filed handles fail this specific test on windows
45+ IOUtils .rm (tmp );
4246 }
4347
4448 public void testTwoClassesInAStreamFromJar () throws IOException {
@@ -57,6 +61,9 @@ public class B {}
5761 List <ClassReader > classReaders = ClassReaders .ofPaths (Stream .of (jar ));
5862 List <String > collect = classReaders .stream ().map (cr -> cr .getClassName ()).collect (Collectors .toList ());
5963 org .hamcrest .MatcherAssert .assertThat (collect , Matchers .containsInAnyOrder ("p/A" , "p/B" ));
64+
65+ // aggressively delete the jar dir, so that any leaked filed handles fail this specific test on windows
66+ IOUtils .rm (tmp );
6067 }
6168
6269 public void testStreamOfJarsAndIndividualClasses () throws IOException {
Original file line number Diff line number Diff line change 88
99package org .elasticsearch .plugin .scanner ;
1010
11+ import org .elasticsearch .core .IOUtils ;
1112import org .elasticsearch .plugin .scanner .test_model .ExtensibleClass ;
1213import org .elasticsearch .plugin .scanner .test_model .ExtensibleInterface ;
1314import org .elasticsearch .plugin .scanner .test_model .TestNamedComponent ;
@@ -100,6 +101,9 @@ public class B implements ExtensibleInterface{}
100101 )
101102 )
102103 );
104+
105+ // aggressively delete the jar dir, so that any leaked filed handles fail this specific test on windows
106+ IOUtils .rm (tmp );
103107 }
104108
105109 public void testNamedComponentsCanExtednCommonSuperClass () throws IOException {
@@ -174,6 +178,9 @@ public class B implements CustomExtensibleInterface{}
174178 )
175179 )
176180 );
181+
182+ // aggressively delete the jar dir, so that any leaked filed handles fail this specific test on windows
183+ IOUtils .rm (tmp );
177184 }
178185
179186 public void testWriteToFile () throws IOException {
You can’t perform that action at this time.
0 commit comments