From fa64368a43cb259645a8cd17b8ee822f7337f344 Mon Sep 17 00:00:00 2001 From: Kefu Chai Date: Sat, 5 Mar 2022 02:45:30 +0800 Subject: [PATCH] test/crimson: use std::for_each() for applying plain function let's just use std::for_each() for applying function not returning future to a range, otherwise we'd have ../src/test/crimson/seastore/test_transaction_manager.cc:950:5: error: no matching function for call to 'parallel_for_each' seastar::parallel_for_each( ^~~~~~~~~~~~~~~~~~~~~~~~~~ ../src/seastar/include/seastar/core/loop.hh:559:1: note: candidate template ignored: constraints not satisfied [with Iterator = boost::iterators::counting_iterator, Sentinel = boost::iterators::counting_iterator, Func = (lambda at ../src/test/crimson/seastore/test_transaction_manager.cc:953:7)] parallel_for_each(Iterator begin, Sentinel end, Func&& func) noexcept { ^ ../src/seastar/include/seastar/core/loop.hh:553:78: note: because type constraint 'std::same_as >' was not satisfied: Signed-off-by: Kefu Chai --- src/test/crimson/seastore/test_transaction_manager.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/crimson/seastore/test_transaction_manager.cc b/src/test/crimson/seastore/test_transaction_manager.cc index 8a7d0f03141ed..ac70b08d35c14 100644 --- a/src/test/crimson/seastore/test_transaction_manager.cc +++ b/src/test/crimson/seastore/test_transaction_manager.cc @@ -947,7 +947,7 @@ TEST_F(transaction_manager_test_t, random_writes_concurrent) constexpr size_t BSIZE = 4<<10; constexpr size_t BLOCKS = TOTAL / BSIZE; run_async([this] { - seastar::parallel_for_each( + std::for_each( boost::make_counting_iterator(0u), boost::make_counting_iterator(WRITE_STREAMS), [&](auto idx) { @@ -963,7 +963,7 @@ TEST_F(transaction_manager_test_t, random_writes_concurrent) break; } } - }).get0(); + }); int writes = 0; unsigned failures = 0; -- 2.39.5