lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hoss...@apache.org
Subject [26/50] [abbrv] lucene-solr:jira/solr-5944: SOLR-9950 Check the difference in counts - meter may not be zero at this point.
Date Mon, 16 Jan 2017 00:10:44 GMT
SOLR-9950 Check the difference in counts - meter may not be zero at this point.


Project: http://git-wip-us.apache.org/repos/asf/lucene-solr/repo
Commit: http://git-wip-us.apache.org/repos/asf/lucene-solr/commit/98422e0d
Tree: http://git-wip-us.apache.org/repos/asf/lucene-solr/tree/98422e0d
Diff: http://git-wip-us.apache.org/repos/asf/lucene-solr/diff/98422e0d

Branch: refs/heads/jira/solr-5944
Commit: 98422e0dc0c7de4635e1bc80bcd5ca70a8d2761a
Parents: 2048b82
Author: Andrzej Bialecki <ab@apache.org>
Authored: Tue Jan 10 11:41:40 2017 +0100
Committer: Andrzej Bialecki <ab@apache.org>
Committed: Tue Jan 10 11:44:16 2017 +0100

----------------------------------------------------------------------
 .../test/org/apache/solr/search/TestRecovery.java    | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/lucene-solr/blob/98422e0d/solr/core/src/test/org/apache/solr/search/TestRecovery.java
----------------------------------------------------------------------
diff --git a/solr/core/src/test/org/apache/solr/search/TestRecovery.java b/solr/core/src/test/org/apache/solr/search/TestRecovery.java
index 7bd0951..f3e98dd 100644
--- a/solr/core/src/test/org/apache/solr/search/TestRecovery.java
+++ b/solr/core/src/test/org/apache/solr/search/TestRecovery.java
@@ -139,6 +139,8 @@ public class TestRecovery extends SolrTestCaseJ4 {
       assertTrue(replayingLogs.getValue().intValue() > 0);
       Gauge<Long> replayingDocs = (Gauge<Long>)metrics.get("TLOG.replay.remaining.bytes");
       assertTrue(replayingDocs.getValue().longValue() > 0);
+      Meter replayDocs = (Meter)metrics.get("TLOG.replay.ops");
+      long initialOps = replayDocs.getCount();
 
       // unblock recovery
       logReplay.release(1000);
@@ -151,8 +153,7 @@ public class TestRecovery extends SolrTestCaseJ4 {
 
       assertJQ(req("q","*:*") ,"/response/numFound==3");
 
-      Meter replayDocs = (Meter)metrics.get("TLOG.replay.ops");
-      assertEquals(5L, replayDocs.getCount());
+      assertEquals(5L, replayDocs.getCount() - initialOps);
       assertEquals(UpdateLog.State.ACTIVE.ordinal(), state.getValue().intValue());
 
       // make sure we can still access versions after recovery
@@ -236,6 +237,10 @@ public class TestRecovery extends SolrTestCaseJ4 {
       assertEquals(UpdateLog.State.BUFFERING, ulog.getState());
       Gauge<Integer> state = (Gauge<Integer>)metrics.get("TLOG.state");
       assertEquals(UpdateLog.State.BUFFERING.ordinal(), state.getValue().intValue());
+      Gauge<Integer> bufferedOps = (Gauge<Integer>)metrics.get("TLOG.buffered.ops");
+      int initialOps = bufferedOps.getValue();
+      Meter applyingBuffered = (Meter)metrics.get("TLOG.applying_buffered.ops");
+      long initialApplyingOps = applyingBuffered.getCount();
 
       // simulate updates from a leader
       updateJ(jsonAdd(sdoc("id","B1", "_version_","1010")), params(DISTRIB_UPDATE_PARAM,FROM_LEADER));
@@ -267,8 +272,7 @@ public class TestRecovery extends SolrTestCaseJ4 {
           ,"=={'doc':null}"
       );
 
-      Gauge<Integer> bufferedOps = (Gauge<Integer>)metrics.get("TLOG.buffered.ops");
-      assertEquals(6, bufferedOps.getValue().intValue());
+      assertEquals(6, bufferedOps.getValue().intValue() - initialOps);
 
       rinfoFuture = ulog.applyBufferedUpdates();
       assertTrue(rinfoFuture != null);
@@ -280,8 +284,7 @@ public class TestRecovery extends SolrTestCaseJ4 {
       UpdateLog.RecoveryInfo rinfo = rinfoFuture.get();
       assertEquals(UpdateLog.State.ACTIVE, ulog.getState());
 
-      Meter applyingBuffered = (Meter)metrics.get("TLOG.applying_buffered.ops");
-      assertEquals(6L, applyingBuffered.getCount());
+      assertEquals(6L, applyingBuffered.getCount() - initialApplyingOps);
 
       assertJQ(req("qt","/get", "getVersions","6")
           ,"=={'versions':[-2010,1030,1020,-1017,1015,1010]}"


Mime
View raw message