Skip to content

Fix async export deletion test flake - #228

Merged
andystaples merged 1 commit into
mainfrom
andystaples-fix-async-export-delete-flake
Jul 29, 2026
Merged

Fix async export deletion test flake#228
andystaples merged 1 commit into
mainfrom
andystaples-fix-async-export-delete-flake

Conversation

@andystaples

Copy link
Copy Markdown
Contributor

Summary

  • wait for the asynchronously signaled export entity deletion before asserting the job is gone
  • use bounded polling instead of an immediate read or fixed sleep

Validation

  • python -m pytest tests/durabletask/extensions/history_export/test_client.py -q
  • repeated test_async_client_create_list_wait_and_delete 10 times
  • python -m flake8 tests/durabletask/extensions/history_export/test_client.py

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 972b0321-8629-4375-b7a5-98cc2fc71a37
Copilot AI review requested due to automatic review settings July 29, 2026 04:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 asyncio import for async-friendly polling and timing.
  • After await job_client.delete(), poll await job_client.describe() until it returns None or a deadline is reached (fail-fast with a clear timeout error).

@berndverst berndverst left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

berndverst

This comment was marked as duplicate.

@andystaples
andystaples merged commit 1270284 into main Jul 29, 2026
25 checks passed
@andystaples
andystaples deleted the andystaples-fix-async-export-delete-flake branch July 29, 2026 05:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants