You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by er...@apache.org on 2019/12/07 00:19:42 UTC

[lucene-solr] branch branch_8x updated: SOLR-13988: Harden CreateCollectionCleanupTest. Incorporate Dawid Weiss' suggestion for windows

This is an automated email from the ASF dual-hosted git repository.

erick pushed a commit to branch branch_8x
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git


The following commit(s) were added to refs/heads/branch_8x by this push:
     new b0ffaca  SOLR-13988: Harden CreateCollectionCleanupTest. Incorporate Dawid Weiss' suggestion for windows
b0ffaca is described below

commit b0ffacab0036bbeacbeba6404f55b0d454a50695
Author: Erick Erickson <Er...@gmail.com>
AuthorDate: Fri Dec 6 19:10:27 2019 -0500

    SOLR-13988: Harden CreateCollectionCleanupTest. Incorporate Dawid Weiss' suggestion for windows
    
    (cherry picked from commit 7d5d44a3c42797b312310df8a7f4af910e052124)
---
 .../test/org/apache/solr/cloud/CreateCollectionCleanupTest.java    | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/solr/core/src/test/org/apache/solr/cloud/CreateCollectionCleanupTest.java b/solr/core/src/test/org/apache/solr/cloud/CreateCollectionCleanupTest.java
index 3f8326c..b8c5b42 100644
--- a/solr/core/src/test/org/apache/solr/cloud/CreateCollectionCleanupTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/CreateCollectionCleanupTest.java
@@ -21,6 +21,7 @@ import static org.hamcrest.CoreMatchers.hasItem;
 import static org.hamcrest.CoreMatchers.is;
 import static org.hamcrest.CoreMatchers.not;
 
+import java.nio.file.Files;
 import java.nio.file.Path;
 import java.util.Properties;
 import org.apache.solr.client.solrj.impl.BaseHttpSolrClient;
@@ -78,7 +79,8 @@ public class CreateCollectionCleanupTest extends SolrCloudTestCase {
 
     Properties properties = new Properties();
     Path tmpDir = createTempDir();
-    tmpDir.toFile().setWritable(false);
+    tmpDir = tmpDir.resolve("foo");
+    Files.createFile(tmpDir);
     properties.put(CoreAdminParams.DATA_DIR, tmpDir.toString());
     create.setProperties(properties);
     expectThrows(BaseHttpSolrClient.RemoteSolrException.class, () -> {
@@ -102,7 +104,8 @@ public class CreateCollectionCleanupTest extends SolrCloudTestCase {
 
     Properties properties = new Properties();
     Path tmpDir = createTempDir();
-    tmpDir.toFile().setWritable(false);
+    tmpDir = tmpDir.resolve("foo");
+    Files.createFile(tmpDir);
     properties.put(CoreAdminParams.DATA_DIR, tmpDir.toString());
     create.setProperties(properties);
     create.setAsyncId("testAsyncCreateCollectionCleanup");