Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
[JENKINS-38696] - Do not delete temporary files in Windows in Prefetc…
…hingTest.

It's a bit weird, but the test uses real classloader, which keeps the files open.
Ideally the tests needs to be fixed in order to stop keeping handlers in JVM, but it's not the top priority right now.
  • Loading branch information
oleg-nenashev committed Nov 13, 2017
1 parent 239f635 commit 276621c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/test/java/hudson/remoting/PrefetchingTest.java
Expand Up @@ -30,7 +30,7 @@ public class PrefetchingTest extends RmiTestBase implements Serializable {
private Checksum sum1,sum2;

@Override
protected void setUp() throws Exception {
protected void setUp() throws Exception {
super.setUp();

URL jar1 = getClass().getClassLoader().getResource("remoting-test-client.jar");
Expand Down Expand Up @@ -68,6 +68,13 @@ protected void tearDown() throws Exception {
cl.cleanup();
super.tearDown();

if (Launcher.isWindows()) {
// Current Resource loader implementation keep files open even if we close the classloader.
// This check has been never working correctly in Windows.
// TODO: Fix it as a part of JENKINS-38696
return;
}

// because the dir is used by FIleSystemJarCache to asynchronously load stuff
// we might fail to shut it down right away
for (int i=0; ; i++) {
Expand Down

0 comments on commit 276621c

Please sign in to comment.