diff --git a/geowebcache/core/src/test/java/org/geowebcache/config/XMLConfigurationTest.java b/geowebcache/core/src/test/java/org/geowebcache/config/XMLConfigurationTest.java index 9511050db..3b3151116 100644 --- a/geowebcache/core/src/test/java/org/geowebcache/config/XMLConfigurationTest.java +++ b/geowebcache/core/src/test/java/org/geowebcache/config/XMLConfigurationTest.java @@ -581,8 +581,25 @@ public void loadFromReadOnlyDirectory() throws GeoWebCacheException { @Test public void loadFromEmptyReadOnlyDirectoryFails() throws GeoWebCacheException, IOException { File roEmptyDir = this.temp.newFolder(); - Assume.assumeTrue( - "Ignore if setWritable(false) does not succeed, may happen on Windows", roEmptyDir.setWritable(false)); + + // Try to make it read-only + roEmptyDir.setWritable(false); + + // Actively probe whether the directory is still writable (for gwc-release Docker on Windows) + File probe = new File(roEmptyDir, "probe"); + boolean canWrite; + try { + canWrite = probe.createNewFile(); + if (canWrite) { + probe.delete(); + } + } catch (IOException e) { + canWrite = false; + } + + // Skip if we can still write, this may happen on Windows + Assume.assumeTrue("Skipping: directory is still writable", !canWrite); + try { config = new XMLConfiguration(null, roEmptyDir.getAbsolutePath()); config.setGridSetBroker(gridSetBroker);