From 571623442ab307c7a92f718a49f6af6f383b8cb3 Mon Sep 17 00:00:00 2001 From: Nuno Campos Date: Wed, 11 Sep 2024 16:45:43 -0700 Subject: [PATCH] Avoid closing drain before seeing first message in either topic --- libs/scheduler-kafka/tests/drain.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/libs/scheduler-kafka/tests/drain.py b/libs/scheduler-kafka/tests/drain.py index 3fefe07cd..84a3463c2 100644 --- a/libs/scheduler-kafka/tests/drain.py +++ b/libs/scheduler-kafka/tests/drain.py @@ -32,7 +32,9 @@ async def drain_topics_async( def done() -> bool: return ( len(orch_msgs) > 0 + and any(orch_msgs) and len(exec_msgs) > 0 + and any(exec_msgs) and not orch_msgs[-1] and not exec_msgs[-1] ) @@ -97,7 +99,9 @@ def drain_topics( def done() -> bool: return ( len(orch_msgs) > 0 + and any(orch_msgs) and len(exec_msgs) > 0 + and any(exec_msgs) and not orch_msgs[-1] and not exec_msgs[-1] )