Skip to content

Commit

Permalink
tests: fix racing mpi test
Browse files Browse the repository at this point in the history
  • Loading branch information
csegarragonz committed Sep 7, 2023
1 parent fcc33b3 commit 972a69e
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tests/test/mpi/test_multiple_mpi_worlds.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -33,16 +33,21 @@ class MultiWorldMpiTestFixture : public MpiBaseTestFixture
{
worldA.destroy();
worldB.destroy();

waitForMpiMessages(reqA, worldSizeA);
waitForMpiMessages(reqB, worldSizeB);
}

protected:
MpiWorld worldA;
std::shared_ptr<BatchExecuteRequest> reqA = nullptr;
std::string userA = "userA";
std::string funcA = "funcA";
int worldIdA = 123;
int worldSizeA = 3;

MpiWorld worldB;
std::shared_ptr<BatchExecuteRequest> reqB = nullptr;
std::string userB = "userB";
std::string funcB = "funcB";
int worldIdB = 245;
Expand Down

0 comments on commit 972a69e

Please sign in to comment.