diff --git a/tests/unit/active/test_active_send.cc b/tests/unit/active/test_active_send.cc index 2ad575a35c..c8748fef27 100644 --- a/tests/unit/active/test_active_send.cc +++ b/tests/unit/active/test_active_send.cc @@ -132,19 +132,19 @@ TEST_F(TestActiveSend, test_type_safe_active_fn_send) { fmt::print("test_type_safe_active_fn_send: node={}\n", my_node); #endif - if (my_node == from_node) { - for (int i = 0; i < num_msg_sent; i++) { - #if DEBUG_TEST_HARNESS_PRINT - fmt::print("{}: sendMsg: i={}\n", my_node, i); - #endif - auto msg = makeMessage(); - theMsg()->sendMsg(1, msg.get()); + runInEpochCollective([=]{ + if (my_node == from_node) { + for (int i = 0; i < num_msg_sent; i++) { + #if DEBUG_TEST_HARNESS_PRINT + fmt::print("{}: sendMsg: i={}\n", my_node, i); + #endif + auto msg = makeMessage(); + theMsg()->sendMsg(1, msg.get()); + } + } else if (my_node == to_node) { + EXPECT_EQ(handler_count, num_msg_sent); } - } else if (my_node == to_node) { - theTerm()->addAction([=]{ - EXPECT_EQ(handler_count, num_msg_sent); - }); - } + }); // Spin here so test_vec does not go out of scope before the send completes while (not vt::rt->isTerminated()) { diff --git a/tests/unit/active/test_pending_send.cc b/tests/unit/active/test_pending_send.cc index 5782afa45c..bdb6e728f3 100644 --- a/tests/unit/active/test_pending_send.cc +++ b/tests/unit/active/test_pending_send.cc @@ -90,7 +90,7 @@ TEST_F(TestPendingSend, test_pending_send_hold) { EXPECT_EQ(envelopeGetEpoch(msg->env), ep); theMsg()->popEpoch(ep); - theTerm()->addAction(ep, [&done] { done = true; }); + runInEpochCollective(ep, [&done] { done = true; }); theTerm()->finishedEpoch(ep); // It should not break out of this loop because of `done`, thus `k` is used to diff --git a/tests/unit/collection/test_checkpoint.extended.cc b/tests/unit/collection/test_checkpoint.extended.cc index 86ea5cda9b..0418e4c0d8 100644 --- a/tests/unit/collection/test_checkpoint.extended.cc +++ b/tests/unit/collection/test_checkpoint.extended.cc @@ -128,7 +128,7 @@ static void runInEpoch(std::function fn) { vt::theMsg()->popEpoch(ep); vt::theTerm()->finishedEpoch(ep); bool done = false; - vt::theTerm()->addAction(ep, [&]{ done = true; }); + runInEpochCollective(ep, [&]{ done = true; }); vt::theSched()->runSchedulerWhile([&] { return not done; }); } diff --git a/tests/unit/collection/test_destroy.cc b/tests/unit/collection/test_destroy.cc index 4dcba01480..aaa2771cbd 100644 --- a/tests/unit/collection/test_destroy.cc +++ b/tests/unit/collection/test_destroy.cc @@ -116,7 +116,7 @@ TEST_F(TestDestroy, test_destroy_1) { // ::fmt::print("broadcasting proxy={:x}\n", proxy.getProxy()); proxy.broadcast(msg.get()); } - theTerm()->addAction([]{ + runInEpochCollective([]{ // ::fmt::print("num destroyed={}\n", num_destroyed); // Relies on default mapping equally distributing EXPECT_EQ(num_destroyed, num_elms_per_node); diff --git a/tests/unit/collection/test_insert.extended.cc b/tests/unit/collection/test_insert.extended.cc index 5bf882c7ce..c0ba83a54d 100644 --- a/tests/unit/collection/test_insert.extended.cc +++ b/tests/unit/collection/test_insert.extended.cc @@ -114,7 +114,7 @@ TEST_F(TestInsert, test_insert_sparse_1) { proxy[i].insert(); } } - theTerm()->addAction([]{ + runInEpochCollective([]{ /// ::fmt::print("num inserted={}\n", num_inserted); // Relies on default mapping equally distributing EXPECT_EQ(num_inserted, num_elms_per_node); diff --git a/tests/unit/collectives/test_mpi_collective.cc b/tests/unit/collectives/test_mpi_collective.cc index 5cd29ac905..fbf4d48d4a 100644 --- a/tests/unit/collectives/test_mpi_collective.cc +++ b/tests/unit/collectives/test_mpi_collective.cc @@ -60,7 +60,7 @@ TEST_F(TestMPICollective, test_mpi_collective_1) { done = true; }); - theTerm()->addAction([&done]{ + runInEpochCollective([&done]{ EXPECT_TRUE(done); }); @@ -104,7 +104,7 @@ TEST_F(TestMPICollective, test_mpi_collective_2) { done++; }); - theTerm()->addAction([&done,&bcast_val,&reduce_val_out]{ + runInEpochCollective([&done,&bcast_val,&reduce_val_out]{ auto num_nodes = theContext()->getNumNodes(); EXPECT_EQ(done, 3); EXPECT_EQ(bcast_val, 29); @@ -234,7 +234,7 @@ TEST_F(TestMPICollective, test_mpi_collective_4) { bool finished_spin = false; - theTerm()->addAction(epoch, [&done,&bcast_val,&reduce_val_out,&finished_spin]{ + runInEpochCollective(epoch, [&done,&bcast_val,&reduce_val_out,&finished_spin]{ auto num_nodes = theContext()->getNumNodes(); EXPECT_EQ(done, 3); EXPECT_EQ(bcast_val, 29);