From 998230d20f9b649c80b31b5563633ba86ff56a27 Mon Sep 17 00:00:00 2001 From: Vlada Dusek Date: Wed, 17 Jun 2026 15:08:15 +0200 Subject: [PATCH] test: deflake request queue aliases e2e test `test_rq_aliases` intermittently failed after reboot because the platform's best-effort batch-add can return a request as unprocessed and the singular `add_request` does not retry it. Use `add_requests`, which retries unprocessed requests, so the added requests survive the reboot. --- tests/e2e/test_actor_request_queue.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/e2e/test_actor_request_queue.py b/tests/e2e/test_actor_request_queue.py index 5bdb46471..3bccf43b9 100644 --- a/tests/e2e/test_actor_request_queue.py +++ b/tests/e2e/test_actor_request_queue.py @@ -109,8 +109,11 @@ async def main() -> None: assert rq_2.name is None if not was_rebooted: - await rq_1.add_request(Request(url='https://example.com/rq_1', unique_key='rq_1')) - await rq_2.add_request(Request(url='https://example.com/rq_2', unique_key='rq_2')) + # The platform's batch-add endpoint is best-effort: a single `add_request` can come back + # unprocessed (returns `None`) without retrying. Use `add_requests`, which retries unprocessed + # requests, so the reboot below never loses a request and the post-reboot fetch is reliable. + await rq_1.add_requests([Request(url='https://example.com/rq_1', unique_key='rq_1')]) + await rq_2.add_requests([Request(url='https://example.com/rq_2', unique_key='rq_2')]) await Actor.set_value('was_rebooted', value=True) await Actor.reboot()