From f45aebeee2166a2004d19f79d8f96c18fbadcdcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patryk=20J=C4=99drzejczak?= Date: Mon, 18 Mar 2024 15:37:24 +0100 Subject: [PATCH] topology_coordinator: cdc_generation_publisher_fiber injection: make handlers share messages In the following commit, we add a test that needs to block the CDC generation publisher's loop twice. We allow it in this commit by making handlers of the `cdc_generation_publisher_fiber` injection share messages. From now on, unblocking every step of the loop will require sending a new message from the test. This change breaks the test already using the `cdc_generation_publisher_fiber` injection, so we adjust the test. --- service/topology_coordinator.cc | 2 +- .../test_cdc_generation_publishing.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/service/topology_coordinator.cc b/service/topology_coordinator.cc index 8f21cbf1ac..53e161b2a8 100644 --- a/service/topology_coordinator.cc +++ b/service/topology_coordinator.cc @@ -663,7 +663,7 @@ class topology_coordinator : public endpoint_lifecycle_subscriber { rtlogger.info("CDC generation publisher fiber sleeps after injection"); co_await handler.wait_for_message(std::chrono::steady_clock::now() + std::chrono::minutes{5}); rtlogger.info("CDC generation publisher fiber finishes sleeping after injection"); - }); + }, false); bool sleep = false; try { diff --git a/test/topology_experimental_raft/test_cdc_generation_publishing.py b/test/topology_experimental_raft/test_cdc_generation_publishing.py index 61731e6424..7385dd4f50 100644 --- a/test/topology_experimental_raft/test_cdc_generation_publishing.py +++ b/test/topology_experimental_raft/test_cdc_generation_publishing.py @@ -111,7 +111,8 @@ async def test_multiple_unpublished_cdc_generations(request, manager: ManagerCli return None # Check that all 4 CDC generations are eventually published in the correct order. - await handler.message() + for _ in range(4): + await handler.message() while len(gen_timestamps) < 4: # We prefer to detect CDC generation publications one-by-one, because it increases our chances of catching # potential bugs like incorrect order of publications. Therefore, we use very short period - 0.01 s.