Skip to content

Commit

Permalink
testing: fix the indent
Browse files Browse the repository at this point in the history
Signed-off-by: Kefu Chai <[email protected]>
  • Loading branch information
tchaikov committed Feb 18, 2025
1 parent 4ba75a0 commit 5539fd0
Showing 1 changed file with 14 additions and 16 deletions.
30 changes: 14 additions & 16 deletions src/testing/test_runner.cc
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,13 @@ bool test_runner::start_thread(int ac, char** av) {
_exit_code = app.run(ac, av, [this, &app, init_outcome = init_outcome.get()] () -> future<int> {
init_outcome->give(true);

// TODO: fix the indent
auto conf_seed = app.configuration()["random-seed"];
auto seed = conf_seed.empty() ? std::random_device()(): conf_seed.as<unsigned>();
std::cout << "random-seed=" << seed << std::endl;
co_await smp::invoke_on_all([seed] {
auto local_seed = seed + this_shard_id();
local_random_engine.seed(local_seed);
});
auto conf_seed = app.configuration()["random-seed"];
auto seed = conf_seed.empty() ? std::random_device()(): conf_seed.as<unsigned>();
std::cout << "random-seed=" << seed << std::endl;
co_await smp::invoke_on_all([seed] {
auto local_seed = seed + this_shard_id();
local_random_engine.seed(local_seed);
});

for (;;) {
// this will block the reactor briefly, but we don't care
Expand All @@ -95,15 +94,14 @@ bool test_runner::start_thread(int ac, char** av) {
break;
}
}
// TODO: fix the indent
if (engine().abandoned_failed_futures()) {
std::cerr << "*** " << engine().abandoned_failed_futures() << " abandoned failed future(s) detected" << std::endl;
if (app.configuration()["fail-on-abandoned-failed-futures"].as<bool>()) {
std::cerr << "Failing the test because fail was requested by --fail-on-abandoned-failed-futures" << std::endl;
co_return 3;
}
if (engine().abandoned_failed_futures()) {
std::cerr << "*** " << engine().abandoned_failed_futures() << " abandoned failed future(s) detected" << std::endl;
if (app.configuration()["fail-on-abandoned-failed-futures"].as<bool>()) {
std::cerr << "Failing the test because fail was requested by --fail-on-abandoned-failed-futures" << std::endl;
co_return 3;
}
co_return 0;
}
co_return 0;
});
init_outcome->give(false);
});
Expand Down

0 comments on commit 5539fd0

Please sign in to comment.