diff options
Diffstat (limited to 'src/test/crimson/test_messenger_thrash.cc')
-rw-r--r-- | src/test/crimson/test_messenger_thrash.cc | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/src/test/crimson/test_messenger_thrash.cc b/src/test/crimson/test_messenger_thrash.cc index 4146ec45b66..246613f4446 100644 --- a/src/test/crimson/test_messenger_thrash.cc +++ b/src/test/crimson/test_messenger_thrash.cc @@ -22,6 +22,8 @@ #include "crimson/net/Messenger.h" #include "test/crimson/ctest_utils.h" +#include <boost/random/uniform_int.hpp> + using namespace std::chrono_literals; namespace bpo = boost::program_options; using crimson::common::local_conf; @@ -447,15 +449,16 @@ class SyntheticWorkload { } seastar::future<> wait_for_done() { - int i = 0; - return seastar::do_until( - [this] { return !dispatcher.get_num_pending_msgs(); }, - [this, &i] - { - if (i++ % 50 == 0){ - print_internal_state(true); - } - return seastar::sleep(100ms); + return seastar::do_with(0, [this] (int &i) { + return seastar::do_until( + [this] { return !dispatcher.get_num_pending_msgs(); }, + [this, &i] { + if (i++ % 50 == 0) { + print_internal_state(true); + } + return seastar::sleep(100ms); + } + ); }).then([this] { return seastar::do_for_each(available_servers, [] (auto server) { if (verbose) { |