From 972a69e4caa81cceb427d1c4b4dae3ad1647553f Mon Sep 17 00:00:00 2001 From: Carlos Segarra Date: Thu, 7 Sep 2023 10:33:23 +0000 Subject: [PATCH] tests: fix racing mpi test --- tests/test/mpi/test_multiple_mpi_worlds.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/tests/test/mpi/test_multiple_mpi_worlds.cpp b/tests/test/mpi/test_multiple_mpi_worlds.cpp index 166d211fb..735556f6e 100644 --- a/tests/test/mpi/test_multiple_mpi_worlds.cpp +++ b/tests/test/mpi/test_multiple_mpi_worlds.cpp @@ -12,8 +12,8 @@ class MultiWorldMpiTestFixture : public MpiBaseTestFixture public: MultiWorldMpiTestFixture() { - auto reqA = faabric::util::batchExecFactory(userA, funcA, 1); - auto reqB = faabric::util::batchExecFactory(userB, funcB, 1); + reqA = faabric::util::batchExecFactory(userA, funcA, 1); + reqB = faabric::util::batchExecFactory(userB, funcB, 1); auto& msgA = *reqA->mutable_messages(0); auto& msgB = *reqB->mutable_messages(0); msgA.set_mpiworldsize(worldSizeA); @@ -33,16 +33,21 @@ class MultiWorldMpiTestFixture : public MpiBaseTestFixture { worldA.destroy(); worldB.destroy(); + + waitForMpiMessages(reqA, worldSizeA); + waitForMpiMessages(reqB, worldSizeB); } protected: MpiWorld worldA; + std::shared_ptr reqA = nullptr; std::string userA = "userA"; std::string funcA = "funcA"; int worldIdA = 123; int worldSizeA = 3; MpiWorld worldB; + std::shared_ptr reqB = nullptr; std::string userB = "userB"; std::string funcB = "funcB"; int worldIdB = 245;