From 118ae0a9ad791b0b3c30ed751b478f74b10991f1 Mon Sep 17 00:00:00 2001 From: Miguel Company Date: Wed, 24 Apr 2024 10:46:42 +0200 Subject: [PATCH] Refs #20658. Improve regression test. Signed-off-by: Miguel Company --- test/blackbox/common/BlackboxTestsSecurity.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/test/blackbox/common/BlackboxTestsSecurity.cpp b/test/blackbox/common/BlackboxTestsSecurity.cpp index ee10e0cd7dc..a4f9afc5a65 100644 --- a/test/blackbox/common/BlackboxTestsSecurity.cpp +++ b/test/blackbox/common/BlackboxTestsSecurity.cpp @@ -3350,19 +3350,26 @@ TEST_P(Security, BuiltinAuthenticationAndAccessAndCryptoPlugin_Permissions_valid for (size_t i = 0; i < num_samples; ++i) { + // Switch to third partition and wait for all entities to unmatch + writer.update_partition("Partition3"); + reader_p_1.wait_writer_undiscovery(); + reader_p_2.wait_writer_undiscovery(); + writer.wait_discovery(0u); + + // Switch partition and wait for the corresponding reader to discover the writer if (0 == i % 2) { writer.update_partition("Partition1"); - reader_p_2.wait_writer_undiscovery(); reader_p_1.wait_discovery(); } else { writer.update_partition("Partition2"); - reader_p_1.wait_writer_undiscovery(); reader_p_2.wait_discovery(); } + // Ensure the writer matches the reader before sending the sample + writer.wait_discovery(1u); writer.send_sample(data.front()); data.pop_front(); writer.waitForAllAcked(std::chrono::milliseconds(100));