Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed incorrect assumptions in replace_whole_group test #5696

Merged
merged 1 commit into from
Jul 28, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/v/raft/tests/membership_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,12 @@ FIXTURE_TEST(replace_whole_group, raft_test_fixture) {
gr.enable_all();
info("replicating some batches");
auto res = replicate_random_batches(gr, 5).get0();
// wait for all group members to have the same log
wait_for(
10s,
[&] { return are_all_commit_indexes_the_same(gr); },
"initially all replicas have the same committed offsets");

// all nodes are replaced with new node
gr.create_new_node(model::node_id(5));
std::vector<raft::broker_revision> new_members;
Expand Down Expand Up @@ -292,7 +298,7 @@ FIXTURE_TEST(replace_whole_group, raft_test_fixture) {
}
auto last_old = old_nodes_log.begin()->second.back().last_offset();
auto last_new = new_nodes_log.begin()->second.back().last_offset();
if (last_new <= last_old) {
if (last_new < last_old) {
return false;
}
return std::all_of(
Expand Down