]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test/crimson: use std::for_each() for applying plain function 45253/head
authorKefu Chai <tchaikov@gmail.com>
Fri, 4 Mar 2022 18:45:30 +0000 (02:45 +0800)
committerKefu Chai <tchaikov@gmail.com>
Fri, 4 Mar 2022 18:47:38 +0000 (02:47 +0800)
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<unsigned int, boost::use_default, boost::use_default>, Sentinel = boost::iterators::counting_iterator<unsigned int, boost::use_default, boost::use_default>, 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<void, future<> >' was not satisfied:

Signed-off-by: Kefu Chai <tchaikov@gmail.com>
src/test/crimson/seastore/test_transaction_manager.cc

index 8a7d0f03141edef11dda1cd6fe10c88b9460ebd9..ac70b08d35c141f172e4ee74a6a1cdc189ef850f 100644 (file)
@@ -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;