From 8a9eedef5f87fb6940f934083c3e7a1274d15818 Mon Sep 17 00:00:00 2001 From: cferreiragonz Date: Thu, 13 Jun 2024 07:56:26 +0200 Subject: [PATCH] Refs #20291: Adjust payload_pool test Signed-off-by: cferreiragonz --- test/blackbox/common/DDSBlackboxTestsBasic.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/test/blackbox/common/DDSBlackboxTestsBasic.cpp b/test/blackbox/common/DDSBlackboxTestsBasic.cpp index 3fb378fde8d..2953dbf96d5 100644 --- a/test/blackbox/common/DDSBlackboxTestsBasic.cpp +++ b/test/blackbox/common/DDSBlackboxTestsBasic.cpp @@ -797,9 +797,15 @@ TEST(DDSBasic, endpoint_custom_payload_pools) std::this_thread::sleep_for(std::chrono::seconds(2)); - // Two consecutive calls to get_payload are expected + // There are 4 calls to get_payload, two for the reader and two for the writer: + // 1. Reader: + // a. The first time the payload allocated in stack is processed (no payload_owner) + // b. Payload used to add the change in reception ASSERT_EQ(reader_payload_pool->requested_payload_count, 2u); - ASSERT_EQ(writer_payload_pool->requested_payload_count, 1u); + // 2. Writer: + // a. Payload requested to the pool when creating the change + // b. Extra call using gather-send to avoid reusing the payload that contains the data before sending it + ASSERT_EQ(writer_payload_pool->requested_payload_count, 2u); participant->delete_contained_entities(); }