Skip to content

Commit e1a3c51

Browse files
committed
Relaxing requirements for best effor tests
Signed-off-by: Emilio Cuesta <emiliocuesta@eprosima.com>
1 parent 25aa27b commit e1a3c51

1 file changed

Lines changed: 20 additions & 4 deletions

File tree

test/blackbox/common/BlackboxTestsSecurity.cpp

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -335,8 +335,16 @@ class Security : public testing::TestWithParam<std::tuple<communication_type, re
335335
writer.send(data);
336336
// In this test all data should be sent.
337337
ASSERT_TRUE(data.empty());
338-
// Block reader until reception finished or timeout.
339-
reader.block_for_all();
338+
339+
if (reliability_ == eprosima::fastdds::dds::BEST_EFFORT_RELIABILITY_QOS)
340+
{
341+
// For best effor, we just check if at least 2 samples are received
342+
reader.block_for_at_least(2);
343+
} else
344+
{
345+
// Block reader until reception finished or timeout.
346+
reader.block_for_all();
347+
}
340348
}
341349

342350
void BuiltinAuthenticationAndAccessAndCryptoPlugin_Permissions_validation_ok_large_data(
@@ -368,8 +376,16 @@ class Security : public testing::TestWithParam<std::tuple<communication_type, re
368376
writer.send(data);
369377
// In this test all data should be sent.
370378
ASSERT_TRUE(data.empty());
371-
// Block reader until reception finished or timeout.
372-
reader.block_for_all();
379+
380+
if (reliability_ == eprosima::fastdds::dds::BEST_EFFORT_RELIABILITY_QOS)
381+
{
382+
// For best effor, we just check if at least 2 samples are received
383+
reader.block_for_at_least(2);
384+
} else
385+
{
386+
// Block reader until reception finished or timeout.
387+
reader.block_for_all();
388+
}
373389
}
374390
};
375391

0 commit comments

Comments
 (0)