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>
This commit is contained in:
Kamil Braun
2022-03-03 11:03:44 +01:00
committed by Tomasz Grabiec
parent eff5076dd5
commit 1c5ab5d80c

View File

@@ -1895,7 +1895,7 @@ SEASTAR_TEST_CASE(snapshot_uses_correct_term_test) {
});
assert(co_await wait_for_leader<ExReg>{}(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<ExReg>{}(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<std::monostate>(
co_await env.reconfigure(id1, {id1, id2}, timer.now() + 100_t, timer)));