raft: replication test: use later()

Instead of sleep 1us use later()

Also use later to yield after sending append entries in rpc test impl.

Signed-off-by: Alejo Sanchez <alejo.sanchez@scylladb.com>
This commit is contained in:
Alejo Sanchez
2021-01-15 15:37:47 -04:00
parent f875ff72c9
commit db95d6e7f1

View File

@@ -4,6 +4,7 @@
#include <seastar/core/coroutine.hh>
#include <seastar/core/loop.hh>
#include <seastar/util/log.hh>
#include <seastar/util/later.hh>
#include "raft/server.hh"
#include "serializer.hh"
#include "serializer_impl.hh"
@@ -548,7 +549,7 @@ future<int> run_test(test_case test) {
for (auto s: partition_servers) {
rafts[s].first->tick();
}
co_await seastar::sleep(1us); // yield
co_await later(); // yield
for (auto s: partition_servers) {
if (rafts[s].first->is_leader()) {
have_leader = true;