From f607a0caaa1573cf3168c617629d33290dc33378 Mon Sep 17 00:00:00 2001 From: "Chris M. Hostetter" Date: Wed, 6 Mar 2013 02:41:47 +0000 Subject: [PATCH] SOLR-2677: test case verifying no false negative errors reported git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1453148 13f79535-47bb-0310-9956-ffa450edef68 --- .../solr/handler/TestReplicationHandler.java | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/solr/core/src/test/org/apache/solr/handler/TestReplicationHandler.java b/solr/core/src/test/org/apache/solr/handler/TestReplicationHandler.java index aa89fc4ad86..070955b6df0 100644 --- a/solr/core/src/test/org/apache/solr/handler/TestReplicationHandler.java +++ b/solr/core/src/test/org/apache/solr/handler/TestReplicationHandler.java @@ -256,6 +256,7 @@ public class TestReplicationHandler extends SolrTestCaseJ4 { @Test public void doTestDetails() throws Exception { + clearIndexWithReplication(); { NamedList details = getDetails(masterClient); @@ -266,7 +267,9 @@ public class TestReplicationHandler extends SolrTestCaseJ4 { assertNotNull("master has master section", details.get("master")); } - { + + // check details on the slave a couple of times before & after fetching + for (int i = 0; i < 3; i++) { NamedList details = getDetails(slaveClient); assertEquals("slave isMaster?", @@ -275,6 +278,17 @@ public class TestReplicationHandler extends SolrTestCaseJ4 { "true", details.get("isSlave")); assertNotNull("slave has slave section", details.get("slave")); + // SOLR-2677: assert not false negatives + Object timesFailed = ((NamedList)details.get("slave")).get(SnapPuller.TIMES_FAILED); + assertEquals("slave has fetch error count", + null, timesFailed); + + if (3 != i) { + // index & fetch + index(masterClient, "id", i, "name", "name = " + i); + masterClient.commit(); + pullFromTo(masterJetty, slaveJetty); + } } SolrInstance repeater = null;