From: Kefu Chai Date: Fri, 4 Mar 2022 18:45:30 +0000 (+0800) Subject: test/crimson: use std::for_each() for applying plain function X-Git-Tag: v18.0.0~1300^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F45253%2Fhead;p=ceph.git 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 --- diff --git a/src/test/crimson/seastore/test_transaction_manager.cc b/src/test/crimson/seastore/test_transaction_manager.cc index 8a7d0f03141e..ac70b08d35c1 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;