From 1c5ab5d80cde24923beb73ebee8b5cdbe7480fca Mon Sep 17 00:00:00 2001 From: Kamil Braun Date: Thu, 3 Mar 2022 11:03:44 +0100 Subject: [PATCH] test: raft: randomized_nemesis_test: when setting up clusters, only create the first server with singleton configuration When setting up clusters in regression tests, a bunch of servers were created, each starting with a singleton configuration containing itself. This is wrong: servers joining to an existing cluster should be started with an empty configuration. It 'worked' because the first server, which we wait for to become a leader before creating the other servers, managed to override the logs and configurations of other servers before they became leaders in their configurations. But if we want to change the logic so that servers in single-server clusters elect themselves as leaders immediately, things start to break. So fix the bug. Message-Id: <20220303100344.6932-1-kbraun@scylladb.com> --- test/raft/randomized_nemesis_test.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/raft/randomized_nemesis_test.cc b/test/raft/randomized_nemesis_test.cc index 647d837ed4..2a67aa3135 100644 --- a/test/raft/randomized_nemesis_test.cc +++ b/test/raft/randomized_nemesis_test.cc @@ -1895,7 +1895,7 @@ SEASTAR_TEST_CASE(snapshot_uses_correct_term_test) { }); assert(co_await wait_for_leader{}(env, {id1}, timer, timer.now() + 1000_t) == id1); - auto id2 = co_await env.new_server(true, + auto id2 = co_await env.new_server(false, raft::server::configuration{ .append_request_threshold = 1, }); @@ -2034,7 +2034,7 @@ SEASTAR_TEST_CASE(removed_follower_with_forwarding_learns_about_removal) { auto id1 = co_await env.new_server(true, cfg); assert(co_await wait_for_leader{}(env, {id1}, timer, timer.now() + 1000_t) == id1); - auto id2 = co_await env.new_server(true, cfg); + auto id2 = co_await env.new_server(false, cfg); assert(std::holds_alternative( co_await env.reconfigure(id1, {id1, id2}, timer.now() + 100_t, timer)));