Skip to content

Apache Lucene open-source search software

SOLR-6956: A better message for DeleteReplicaTest failures

Shalin Shekhar Mangaraa2bc27bacc3
diff --git a/solr/core/src/test/org/apache/solr/cloud/DeleteReplicaTest.java b/solr/core/src/test/org/apache/solr/cloud/DeleteReplicaTest.java
index 18ac8e8549b..915cc69248e 100644
--- a/solr/core/src/test/org/apache/solr/cloud/DeleteReplicaTest.java
+++ b/solr/core/src/test/org/apache/solr/cloud/DeleteReplicaTest.java
@@ -117,7 +117,7 @@ public class DeleteReplicaTest extends AbstractFullDistribZkTestBase {
fail("Should have thrown an exception here because the replica is NOT down");
} catch (SolrException se) {
assertEquals("Should see 400 here ", se.code(), 400);
- assertTrue("Should have had a good message here", se.getMessage().contains("with onlyIfDown='true', but state is 'active'"));
+ assertTrue("Expected DeleteReplica to fail because node state is 'active' but returned message was: " + se.getMessage(), se.getMessage().contains("with onlyIfDown='true', but state is 'active'"));
// This bit is a little weak in that if we're screwing up and actually deleting the replica, we might get back
// here _before_ the datadir is deleted. But I'd rather not introduce a delay here.
assertTrue("dataDir for " + replica1.getName() + " should NOT have been deleted by deleteReplica API with onlyIfDown='true'",