Skip to content

Commit 998230d

Browse files
committed
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.
1 parent a4de527 commit 998230d

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

tests/e2e/test_actor_request_queue.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,11 @@ async def main() -> None:
109109
assert rq_2.name is None
110110

111111
if not was_rebooted:
112-
await rq_1.add_request(Request(url='https://example.com/rq_1', unique_key='rq_1'))
113-
await rq_2.add_request(Request(url='https://example.com/rq_2', unique_key='rq_2'))
112+
# The platform's batch-add endpoint is best-effort: a single `add_request` can come back
113+
# unprocessed (returns `None`) without retrying. Use `add_requests`, which retries unprocessed
114+
# requests, so the reboot below never loses a request and the post-reboot fetch is reliable.
115+
await rq_1.add_requests([Request(url='https://example.com/rq_1', unique_key='rq_1')])
116+
await rq_2.add_requests([Request(url='https://example.com/rq_2', unique_key='rq_2')])
114117
await Actor.set_value('was_rebooted', value=True)
115118
await Actor.reboot()
116119

0 commit comments

Comments
 (0)