Skip to content

Commit

Permalink
Improve IgnoreNonExistentSegment test (#4036)
Browse files Browse the repository at this point in the history
* Refs #19887. Platform specific behavior on IgnoreNonExistentSegment test.

Signed-off-by: Miguel Company <[email protected]>

* Refs #19887. Use `num_threads` in loop.

Signed-off-by: Miguel Company <[email protected]>

---------

Signed-off-by: Miguel Company <[email protected]>
  • Loading branch information
MiguelCompany authored Nov 24, 2023
1 parent 595ee2c commit d81a024
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions test/blackbox/common/BlackboxTestsTransportSHM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,12 +114,18 @@ TEST(SHM, IgnoreNonExistentSegment)
reader.wait_discovery();

// Create and quickly destroy several participants in several threads
#ifdef _WIN32
constexpr size_t num_threads = 1;
constexpr size_t num_parts = 2;
#else
constexpr size_t num_threads = 10;
constexpr size_t num_parts = 10;
#endif // _WIN32
std::vector<std::thread> threads;
for (size_t i = 0; i < 10; i++)
for (size_t i = 0; i < num_threads; i++)
{
threads.push_back(std::thread([]()
threads.push_back(std::thread([num_parts]()
{
constexpr size_t num_parts = 10;
for (size_t i = 0; i < num_parts; ++i)
{
PubSubWriter<Data1mbPubSubType> late_writer(TEST_TOPIC_NAME);
Expand Down

0 comments on commit d81a024

Please sign in to comment.