sstable_test_env: Coroutinize and move to .cc test_env::stop()

It's going to get larger, so better to move.
Also when coroutinized it's goind to be easier to extend.

Signed-off-by: Pavel Emelyanov <xemul@scylladb.com>
This commit is contained in:
Pavel Emelyanov
2023-10-25 15:25:02 +03:00
parent 949e9f1205
commit 8d704f2532
2 changed files with 6 additions and 5 deletions

View File

@@ -79,11 +79,7 @@ public:
explicit test_env(test_env_config cfg = {}, sstables::storage_manager* sstm = nullptr) : _impl(std::make_unique<impl>(std::move(cfg), sstm)) { }
future<> stop() {
return _impl->mgr.close().finally([this] {
return _impl->semaphore.stop();
});
}
future<> stop();
sstables::generation_type new_generation() noexcept {
return _impl->new_generation();

View File

@@ -215,6 +215,11 @@ test_env::impl::impl(test_env_config cfg, sstables::storage_manager* sstm)
}
}
future<> test_env::stop() {
co_await _impl->mgr.close();
co_await _impl->semaphore.stop();
}
future<> test_env::do_with_async(noncopyable_function<void (test_env&)> func, test_env_config cfg) {
if (!cfg.storage.is_local_type()) {
struct test_env_with_cql {