Skip to content

[22995] Fix MacOS nightly flaky tests #5738

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 1, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 15 additions & 6 deletions test/blackbox/common/BlackboxTestsDiscovery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1577,20 +1577,29 @@ TEST_P(Discovery, single_unicast_pdp_response_flowcontroller)
for (auto& participant : participants)
{
ASSERT_TRUE(participant->init_participant());
participant->wait_discovery(std::chrono::seconds(1), 1, true);
participant->wait_discovery(std::chrono::seconds::zero(), 1, true);
}

main_participant->wait_discovery(std::chrono::seconds::zero(), 5, true);

// When in single threaded application, give some time for the builtin endpoints matching
std::this_thread::sleep_for(std::chrono::seconds(5));

// Destroy main participant
main_participant.reset();
for (auto& participant : participants)
{
participant->wait_discovery(std::chrono::seconds(1), 0, true);
participant->wait_discovery(std::chrono::seconds::zero(), 0, true);
}

std::this_thread::sleep_for(std::chrono::milliseconds(100));
// Check that only two unicast messages per participant were sent
EXPECT_EQ(num_unicast_sends.load(std::memory_order::memory_order_seq_cst),
participants.size() + participants.size());
// Check that the main participant sends two unicast messages to every other participant.
// One Data[P] and one Data[uP].
// Note that in a single core system, the number of unicast messages sent may be one
// per participant since the main participant's destruction races with
// the asynchronous Data[uP] in the locator selector (the unicast locator of the remote may not be there by the time)
// using the multicast instead.
EXPECT_GE(num_unicast_sends.load(std::memory_order::memory_order_seq_cst),
participants.size());

// Clean up
participants.clear();
Expand Down
7 changes: 6 additions & 1 deletion test/blackbox/common/DDSBlackboxTestsMonitorService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -639,6 +639,11 @@ class MonitorServiceConsumer : protected PubSubReader<MonitorServiceType>
return PubSubReader<MonitorServiceType>::block_for_all(time);
}

void block_for_all()
{
PubSubReader<MonitorServiceType>::block_for_all();
}

void stop()
{
destroy();
Expand Down Expand Up @@ -2648,7 +2653,7 @@ TEST(DDSMonitorServiceTest, monitor_service_advanced_extended_incompatible_qos)
}

//! Assertions
ASSERT_EQ(MSC.block_for_all(std::chrono::seconds(5)), expected_msgs.size());
MSC.block_for_all();

#endif //FASTDDS_STATISTICS
}
Expand Down
Loading