Skip to content

Commit

Permalink
r/tests: enabled replace_whole_group test
Browse files Browse the repository at this point in the history
After fixing vote issues during configuration update, enabled back the
`replace_whole_group` test.

Signed-off-by: Michal Maslanka <michal@vectorized.io>
  • Loading branch information
mmaslankaprv committed Jan 4, 2021
1 parent be377cc commit 7beadf4
Showing 1 changed file with 14 additions and 8 deletions.
22 changes: 14 additions & 8 deletions src/v/raft/tests/membership_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,6 @@ FIXTURE_TEST(try_remove_all_voters, raft_test_fixture) {
BOOST_REQUIRE_EQUAL(result, raft::errc::invalid_configuration_update);
}

// TODO: Fix failing test. For more details see: #342
#if 0
FIXTURE_TEST(replace_whole_group, raft_test_fixture) {
raft_group gr = raft_group(raft::group_id(0), 3);
gr.enable_all();
Expand Down Expand Up @@ -251,11 +249,19 @@ FIXTURE_TEST(replace_whole_group, raft_test_fixture) {
},
"new nodes are up to date");

info("waiting for new group leader");
auto new_leader_id = wait_for_group_leader(gr);
auto& new_leader = gr.get_member(new_leader_id);
wait_for(
5s,
[&gr]() {
info("waiting for new group leader");
auto new_leader_id = wait_for_group_leader(gr);

BOOST_REQUIRE_GT(new_leader_id, model::node_id(4));
BOOST_REQUIRE_EQUAL(new_leader.consensus->config().brokers().size(), 3);
return new_leader_id >= model::node_id(4);
},
"one of new nodes is a leader");

auto new_leader_id = gr.get_leader_id();
if (new_leader_id) {
auto& new_leader = gr.get_member(*new_leader_id);
BOOST_REQUIRE_EQUAL(new_leader.consensus->config().brokers().size(), 3);
}
}
#endif

0 comments on commit 7beadf4

Please sign in to comment.