diff --git a/plugins/quota-aware-fs/src/test/java/org/elasticsearch/fs/quotaaware/QuotaAwareFileSystemProviderTests.java b/plugins/quota-aware-fs/src/test/java/org/elasticsearch/fs/quotaaware/QuotaAwareFileSystemProviderTests.java index 99452331952d..9041ee3b2535 100644 --- a/plugins/quota-aware-fs/src/test/java/org/elasticsearch/fs/quotaaware/QuotaAwareFileSystemProviderTests.java +++ b/plugins/quota-aware-fs/src/test/java/org/elasticsearch/fs/quotaaware/QuotaAwareFileSystemProviderTests.java @@ -267,9 +267,12 @@ public class QuotaAwareFileSystemProviderTests extends LuceneTestCase { FileSystemProvider systemProvider = quotaFile.getFileSystem().provider(); DelegatingProvider cyclicProvider = new DelegatingProvider(systemProvider) { @Override + @SuppressForbidden(reason = "Uses new File() to work around test issue on Windows") public Path getPath(URI uri) { try { - return cyclicReference.getFileSystem(new URI("file:///")).getPath(uri.getPath()); + // This convoluted line is necessary in order to get a valid path on Windows. + final String uriPath = new File(uri.getPath()).toPath().toString(); + return cyclicReference.getFileSystem(new URI("file:///")).getPath(uriPath); } catch (URISyntaxException e) { throw new RuntimeException(e); }