Permalink
Browse files

[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 276621c4e913d807aab8885514784d5740e6ccd7
Showing with 8 additions and 1 deletion.
  1. +8 −1 src/test/java/hudson/remoting/PrefetchingTest.java
@@ -30,7 +30,7 @@
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");
@@ -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++) {

0 comments on commit 276621c

Please sign in to comment.