diff --git a/test/exec/test_repeat_effect_until.cpp b/test/exec/test_repeat_effect_until.cpp index 7c2508c32..b511f1d9b 100644 --- a/test/exec/test_repeat_effect_until.cpp +++ b/test/exec/test_repeat_effect_until.cpp @@ -161,4 +161,22 @@ namespace { REQUIRE(called); } + + TEST_CASE("repeat_effect_until works with bulk on a static_thread_pool", "[adaptors][repeat_n]") { + exec::static_thread_pool pool{2}; + std::atomic failed{false}; + const auto tid = std::this_thread::get_id(); + bool called{false}; + ex::sender auto snd = stdexec::on( + pool.get_scheduler(), ex::just() | ex::bulk(ex::par_unseq, 1024, [&](int index) noexcept { + if (tid == std::this_thread::get_id()) { + failed = true; + } + }) | ex::then([&] { + called = true; + return called; + }) | exec::repeat_effect_until()); + stdexec::sync_wait(std::move(snd)); + REQUIRE(called); + } } // namespace diff --git a/test/exec/test_repeat_n.cpp b/test/exec/test_repeat_n.cpp index 4992d5778..2c3d14682 100644 --- a/test/exec/test_repeat_n.cpp +++ b/test/exec/test_repeat_n.cpp @@ -124,10 +124,28 @@ namespace { TEST_CASE("repeat_n works when changing threads", "[adaptors][repeat_n]") { exec::static_thread_pool pool{2}; bool called{false}; - sender auto snd = stdexec::on(pool.get_scheduler(), ex::just() | ex::then([&] { - called = true; - }) | exec::repeat_n(10)); - stdexec::sync_wait(std::move(snd)); + sender auto snd = ex::on(pool.get_scheduler(), ex::just() | ex::then([&] { + called = true; + }) | exec::repeat_n(10)); + ex::sync_wait(std::move(snd)); + REQUIRE(called); + } + + TEST_CASE("repeat_n works with bulk on a static_thread_pool", "[adaptors][repeat_n]") { + exec::static_thread_pool pool{2}; + std::atomic failed{false}; + const auto tid = std::this_thread::get_id(); + bool called{false}; + sender auto snd = + ex::on(pool.get_scheduler(), ex::just() | ex::bulk(ex::par_unseq, 1024, [&](int) noexcept { + if (tid == std::this_thread::get_id()) { + failed = true; + } + }) | ex::then([&] { + called = true; + }) | exec::repeat_n(10)); + ex::sync_wait(std::move(snd)); REQUIRE(called); + REQUIRE(!failed.load()); } } // namespace