Skip to content

fix(tests): replace sleeps with anyio.Event in test_progress_notifications#2062

Closed
Kludex wants to merge 1 commit intomainfrom
fix/test-progress-notifications-replace-sleeps
Closed

fix(tests): replace sleeps with anyio.Event in test_progress_notifications#2062
Kludex wants to merge 1 commit intomainfrom
fix/test-progress-notifications-replace-sleeps

Conversation

@Kludex
Copy link
Member

@Kludex Kludex commented Feb 14, 2026

Summary

  • Replace await anyio.sleep(0.5) in test_bidirectional_progress_notifications and test_progress_context_manager with anyio.Event primitives
  • Each progress handler sets the event when the expected number of updates (3 and 4 respectively) have been received
  • The waits are protected by fail_after(5) for safety, saving ~1s of unnecessary sleep per test run

Test plan

  • uv run --frozen pytest tests/shared/test_progress_notifications.py -x -q passes (3/3)

…tions

Replace `await anyio.sleep(0.5)` in both `test_bidirectional_progress_notifications`
and `test_progress_context_manager` with `anyio.Event` primitives that fire
when the expected number of progress updates have been received by the server.
The events are protected by `fail_after(5)` for safety.
@Kludex Kludex closed this Feb 14, 2026
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.

1 participant