diff --git a/test/src/main/java/org/jvnet/hudson/test/HudsonTestCase.java b/test/src/main/java/org/jvnet/hudson/test/HudsonTestCase.java index 46586c9..a013dec 100644 --- a/test/src/main/java/org/jvnet/hudson/test/HudsonTestCase.java +++ b/test/src/main/java/org/jvnet/hudson/test/HudsonTestCase.java @@ -454,6 +454,7 @@ public abstract class HudsonTestCase extends TestCase implements RootAction { * that we need for testing. */ protected ServletContext createWebServer() throws Exception { + String os = System.getProperty("os.name").toLowerCase(); server = new Server(); WebAppContext context = new WebAppContext(WarExploder.getExplodedDir().getPath(), contextPath); @@ -461,6 +462,11 @@ public abstract class HudsonTestCase extends TestCase implements RootAction { context.setConfigurations(new Configuration[]{new WebXmlConfiguration(), new NoListenerConfiguration()}); server.setHandler(context); context.setMimeTypes(MIME_TYPES); + if(os.indexOf("win") >= 0) { + // this is only needed on Windows because of the file + // locking issue as described in JENKINS-12647 + context.setCopyWebDir(true); + } SocketConnector connector = new SocketConnector(); connector.setHeaderBufferSize(12*1024); // use a bigger buffer as Stapler traces can get pretty large on deeply nested URL