Repository: kudu Updated Branches: refs/heads/master 0815a1238 -> 19c47e659
[itests] fix flake in raft_consensus_nonvoter-itest Fixed flake in RaftConsensusNonVoterITest::RestartClusterWithNonVoter scenario in the case when a newly added replica becomes a leader. The flake was most prominent with ASAN builds. Below are links to the dist_test results of ASAN builds, with and without the fix: before the fix (50 of 256 failed): http://dist-test.cloudera.org/job?job_id=aserbin.1519227435.49089 after the fix (0 of 256 failed): http://dist-test.cloudera.org/job?job_id=aserbin.1519227218.43636 Change-Id: I0b27eec4e9a4727b96689d4e9592b1f1684ebf54 Reviewed-on: http://gerrit.cloudera.org:8080/9380 Tested-by: Kudu Jenkins Reviewed-by: Mike Percy <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/kudu/repo Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/19c47e65 Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/19c47e65 Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/19c47e65 Branch: refs/heads/master Commit: 19c47e6596cc4a58541dcbf9d900bd37eaff618b Parents: 0815a12 Author: Alexey Serbin <[email protected]> Authored: Wed Feb 21 07:26:24 2018 -0800 Committer: Alexey Serbin <[email protected]> Committed: Wed Feb 21 20:55:15 2018 +0000 ---------------------------------------------------------------------- src/kudu/integration-tests/raft_consensus_nonvoter-itest.cc | 5 +++++ 1 file changed, 5 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/kudu/blob/19c47e65/src/kudu/integration-tests/raft_consensus_nonvoter-itest.cc ---------------------------------------------------------------------- diff --git a/src/kudu/integration-tests/raft_consensus_nonvoter-itest.cc b/src/kudu/integration-tests/raft_consensus_nonvoter-itest.cc index 8908029..8e991a4 100644 --- a/src/kudu/integration-tests/raft_consensus_nonvoter-itest.cc +++ b/src/kudu/integration-tests/raft_consensus_nonvoter-itest.cc @@ -1701,6 +1701,11 @@ TEST_F(RaftConsensusNonVoterITest, RestartClusterWithNonVoter) { ANY_REPLICA, &has_leader, &tablet_locations)); + // The newly added replica needs to be registered in the internal + // tablet_replicas_: this is necessary for the future calls like + // GetLeaderReplicaWithRetries() when the replica becomes a leader. + NO_FATALS(WaitForReplicasAndUpdateLocations(table_->name())); + consensus::ConsensusStatePB cstate; ASSERT_EVENTUALLY([&] { TServerDetails* leader = nullptr;
