Fix async export deletion test flake - #228
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 972b0321-8629-4375-b7a5-98cc2fc71a37
There was a problem hiding this comment.
Pull request overview
This PR addresses a flaky async history export deletion test by replacing an immediate post-delete read with bounded polling, ensuring the export entity deletion signal has been processed before asserting the job is gone.
Changes:
- Add
asyncioimport for async-friendly polling and timing. - After
await job_client.delete(), pollawait job_client.describe()until it returnsNoneor a deadline is reached (fail-fast with a clear timeout error).
berndverst
left a comment
There was a problem hiding this comment.
Reviewed the async deletion race at 075808d. SignalEntity acknowledges enqueueing rather than completed entity processing, so the prior immediate read was racy. The replacement polls the same observable deletion condition with a monotonic 5-second bound and 50 ms async sleeps, and still fails if deletion never occurs. No production/API compatibility change. Focused test passed repeatedly, including a delayed-deletion probe, and the changed test passes flake8.
Summary
Validation
python -m pytest tests/durabletask/extensions/history_export/test_client.py -qtest_async_client_create_list_wait_and_delete10 timespython -m flake8 tests/durabletask/extensions/history_export/test_client.py