File tree Expand file tree Collapse file tree 1 file changed +19
-2
lines changed
geowebcache/core/src/test/java/org/geowebcache/config Expand file tree Collapse file tree 1 file changed +19
-2
lines changed Original file line number Diff line number Diff line change @@ -581,8 +581,25 @@ public void loadFromReadOnlyDirectory() throws GeoWebCacheException {
581581 @ Test
582582 public void loadFromEmptyReadOnlyDirectoryFails () throws GeoWebCacheException , IOException {
583583 File roEmptyDir = this .temp .newFolder ();
584- Assume .assumeTrue (
585- "Ignore if setWritable(false) does not succeed, may happen on Windows" , roEmptyDir .setWritable (false ));
584+
585+ // Try to make it read-only
586+ roEmptyDir .setWritable (false );
587+
588+ // Actively probe whether the directory is still writable (for gwc-release Docker on Windows)
589+ File probe = new File (roEmptyDir , "probe" );
590+ boolean canWrite ;
591+ try {
592+ canWrite = probe .createNewFile ();
593+ if (canWrite ) {
594+ probe .delete ();
595+ }
596+ } catch (IOException e ) {
597+ canWrite = false ;
598+ }
599+
600+ // Skip if we can still write, this may happen on Windows
601+ Assume .assumeTrue ("Skipping: directory is still writable" , !canWrite );
602+
586603 try {
587604 config = new XMLConfiguration (null , roEmptyDir .getAbsolutePath ());
588605 config .setGridSetBroker (gridSetBroker );
You can’t perform that action at this time.
0 commit comments