You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kudu.apache.org by mp...@apache.org on 2016/12/14 14:19:44 UTC

[2/2] kudu git commit: Avoid flakiness in RaftConsensusITest.TestReplaceOperationStuckInPrepareQueue

Avoid flakiness in RaftConsensusITest.TestReplaceOperationStuckInPrepareQueue

Change-Id: I58027417a93c14db14ac9139f1bef530d552bba0
Reviewed-on: http://gerrit.cloudera.org:8080/5467
Tested-by: Kudu Jenkins
Reviewed-by: Mike Percy <mp...@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/kudu/repo
Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/2b0bb511
Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/2b0bb511
Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/2b0bb511

Branch: refs/heads/master
Commit: 2b0bb51167666f9beb26a7fe442b3a744bf8cacf
Parents: a684b7a
Author: Todd Lipcon <to...@apache.org>
Authored: Sun Dec 11 23:01:55 2016 +0800
Committer: Mike Percy <mp...@apache.org>
Committed: Wed Dec 14 14:19:01 2016 +0000

----------------------------------------------------------------------
 src/kudu/integration-tests/raft_consensus-itest.cc | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kudu/blob/2b0bb511/src/kudu/integration-tests/raft_consensus-itest.cc
----------------------------------------------------------------------
diff --git a/src/kudu/integration-tests/raft_consensus-itest.cc b/src/kudu/integration-tests/raft_consensus-itest.cc
index 5c3f79f..4d284e4 100644
--- a/src/kudu/integration-tests/raft_consensus-itest.cc
+++ b/src/kudu/integration-tests/raft_consensus-itest.cc
@@ -1401,10 +1401,16 @@ TEST_F(RaftConsensusITest, TestReplaceOperationStuckInPrepareQueue) {
   ASSERT_FALSE(resp.has_error()) << resp.DebugString();
 
   // Ensure we can read the data.
-  vector<string> results;
-  NO_FATALS(WaitForRowCount(replica_ts->tserver_proxy.get(), 2, &results));
-  ASSERT_EQ("(int32 key=1, int32 int_val=3, string string_val=\"term: 3 index: 4\")", results[0]);
-  ASSERT_EQ("(int32 key=2, int32 int_val=3, string string_val=\"term: 3 index: 5\")", results[1]);
+  // We need to AssertEventually here because otherwise it's possible to read the old value
+  // of row '1', if the operation is still in flight.
+  AssertEventually([&]() {
+      vector<string> results;
+      NO_FATALS(WaitForRowCount(replica_ts->tserver_proxy.get(), 2, &results));
+      ASSERT_EQ("(int32 key=1, int32 int_val=3, string string_val=\"term: 3 index: 4\")",
+                results[0]);
+      ASSERT_EQ("(int32 key=2, int32 int_val=3, string string_val=\"term: 3 index: 5\")",
+                results[1]);
+    });
 }
 
 // Regression test for KUDU-644: