You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by ja...@apache.org on 2020/06/08 08:47:57 UTC
[lucene-solr] branch branch_8x updated: SOLR-9679: Harden
BasicAuthOnSingleNodeTest#testDeleteSecurityJsonZnode
This is an automated email from the ASF dual-hosted git repository.
janhoy 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 0035a5b SOLR-9679: Harden BasicAuthOnSingleNodeTest#testDeleteSecurityJsonZnode
0035a5b is described below
commit 0035a5be76b8b9584a5c43bf8158e2fefb5fb9f2
Author: Jan Høydahl <ja...@apache.org>
AuthorDate: Mon Jun 8 10:46:53 2020 +0200
SOLR-9679: Harden BasicAuthOnSingleNodeTest#testDeleteSecurityJsonZnode
(cherry picked from commit 3e538005ecb4dd20fb05c6da4e20a20e846a2a3f)
---
.../apache/solr/security/BasicAuthOnSingleNodeTest.java | 16 +++++++++++++++-
1 file changed, 15 insertions(+), 1 deletion(-)
diff --git a/solr/core/src/test/org/apache/solr/security/BasicAuthOnSingleNodeTest.java b/solr/core/src/test/org/apache/solr/security/BasicAuthOnSingleNodeTest.java
index a904009..766e092 100644
--- a/solr/core/src/test/org/apache/solr/security/BasicAuthOnSingleNodeTest.java
+++ b/solr/core/src/test/org/apache/solr/security/BasicAuthOnSingleNodeTest.java
@@ -80,7 +80,21 @@ public class BasicAuthOnSingleNodeTest extends SolrCloudAuthTestCase {
// Deleting security.json will disable security - before SOLR-9679 it would instead cause an exception
cluster.getZkClient().delete("/security.json", -1, false);
- assertNotNull(new QueryRequest(params("q", "*:*")).process(client, COLLECTION));
+ int count = 0;
+ boolean done = false;
+ // Assert that security is turned off. This is async, so we retry up to 5s before failing the test
+ while (!done) {
+ try {
+ Thread.sleep(500);
+ count += 1;
+ new QueryRequest(params("q", "*:*")).process(client, COLLECTION);
+ done = true;
+ } catch (Exception e) {
+ if (count >= 10) {
+ fail("Failed 10 times to query without credentials after removing security.json");
+ }
+ }
+ }
}
}