diff --git a/tests/test/mpi/test_mpi_context.cpp b/tests/test/mpi/test_mpi_context.cpp index 3bc667877..c2508e602 100644 --- a/tests/test/mpi/test_mpi_context.cpp +++ b/tests/test/mpi/test_mpi_context.cpp @@ -108,7 +108,8 @@ TEST_CASE_METHOD(MpiBaseTestFixture, "Check joining world", "[mpi]") auto chainedMsgs = faabric::util::getChainedFunctions(msgA); REQUIRE(chainedMsgs.size() == worldSize - 1); - auto msgB = plannerCli.getMessageResult(msgA.appid(), *chainedMsgs.begin(), 500); + auto msgB = + plannerCli.getMessageResult(msgA.appid(), *chainedMsgs.begin(), 500); // Create another context and make sure it's not initialised MpiContext cB; diff --git a/tests/test/mpi/test_multiple_mpi_worlds.cpp b/tests/test/mpi/test_multiple_mpi_worlds.cpp index 9e6d1ca40..70b91be16 100644 --- a/tests/test/mpi/test_multiple_mpi_worlds.cpp +++ b/tests/test/mpi/test_multiple_mpi_worlds.cpp @@ -61,6 +61,7 @@ TEST_CASE_METHOD(MpiBaseTestFixture, "Test creating two MPI worlds", "[mpi]") int worldSizeA = 3; auto reqA = faabric::util::batchExecFactory(userA, funcA, 1); auto& msgA = *reqA->mutable_messages(0); + msgA.set_ismpi(true); msgA.set_mpiworldid(worldIdA); msgA.set_mpiworldsize(worldSizeA); plannerCli.callFunctions(reqA); @@ -73,6 +74,7 @@ TEST_CASE_METHOD(MpiBaseTestFixture, "Test creating two MPI worlds", "[mpi]") int worldSizeB = 6; auto reqB = faabric::util::batchExecFactory(userB, funcB, 1); auto& msgB = *reqB->mutable_messages(0); + msgB.set_ismpi(true); msgB.set_mpiworldid(worldIdB); msgB.set_mpiworldsize(worldSizeB); plannerCli.callFunctions(reqB); @@ -90,6 +92,9 @@ TEST_CASE_METHOD(MpiBaseTestFixture, "Test creating two MPI worlds", "[mpi]") // Check that chained function calls are made as expected auto actual = sch.getRecordedMessagesAll(); + // The first recorded message is sent as part of the test fixture, so we + // remove it + actual.erase(actual.begin()); int expectedMsgCount = worldSizeA + worldSizeB; REQUIRE(actual.size() == expectedMsgCount); diff --git a/tests/utils/fixtures.h b/tests/utils/fixtures.h index 968d9ee85..b78dc6c76 100644 --- a/tests/utils/fixtures.h +++ b/tests/utils/fixtures.h @@ -515,10 +515,8 @@ class RemoteMpiTestFixture : public MpiBaseTestFixture // Set up the other world and add it to the global set of hosts faabric::HostResources otherResources; otherResources.set_slots(ranksOtherWorld); - sch.addHostToGlobalSet(otherHost); - - // Queue the resource response for this other host - faabric::scheduler::queueResourceResponse(otherHost, otherResources); + sch.addHostToGlobalSet( + otherHost, std::make_shared(otherResources)); } protected: