Files
scylladb/test/lib/eventually.cc
Avi Kivity 0ae22a09d4 LICENSE: Update to version 1.1
Updated terms of non-commercial use (must be a never-customer).
2026-04-12 19:46:33 +03:00

22 lines
528 B
C++

/*
* Copyright (C) 2019-present ScyllaDB
*/
/*
* SPDX-License-Identifier: LicenseRef-ScyllaDB-Source-Available-1.1
*/
#include "test/lib/eventually.hh"
sleep_fn seastar_sleep_fn = [] (std::chrono::milliseconds ms) -> future<> {
return seastar::sleep(ms);
};
sleep_fn manual_clock_sleep_fn = [] (std::chrono::milliseconds ms) -> future<> {
auto end = manual_clock::now() + ms;
while (manual_clock::now() < end) {
manual_clock::advance(std::chrono::milliseconds(1));
co_await yield();
}
};