Repository navigation
TEST: Coordinate realtime callback delivery explicitly - #3453
Roman Lutz (romanlutz) merged 3 commits into
Conversation
Replace fixed sleeps and polling with callback and dispatcher completion signals. Prove callbacks overlap before release and always clean up owned tasks. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 4d7642e0-787d-45bf-9615-a83fce946f63
…llback-coordination
|
Review authored by GitHub Copilot, posted on my behalf. The new callback gates preserve the concurrency check and remove fixed sleeps. To complete the realtime reliability work, please address these related gaps in this PR. These are existing gaps, not regressions introduced here:
This keeps the existing behavior checks, adds no success-path delay, and applies the same readiness and cleanup rules across the related realtime tests. |
Richard Lundeen (richlundeen)
left a comment
There was a problem hiding this comment.
Approved. The callback coordination changes are sound. The adjacent-test scope comments are non-blocking follow-up work.
Review prepared by GitHub Copilot and submitted at my request.
Use shared watchdogs and failure-safe dispatcher shutdown. Coordinate streaming failure registration and chunk delivery explicitly, release cancellation gates in finally, and retain and drain session helper tasks on errors. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 4d7642e0-787d-45bf-9615-a83fce946f63
|
Addressed all three follow-up items in 4aaf363:
Validation: |
Description
Replace fixed sleeps and callback-delivery polling in realtime tests with explicit delivery futures and dispatcher completion signals, using the existing test watchdog helper.
The concurrency regression now proves that both callbacks enter while the release gate is closed and neither has finished. It then releases and awaits both callbacks. Failure cleanup releases the gate and stops the dispatcher so owned tasks do not leak. Legitimate scheduling yields and actual deadline coverage are unchanged. No production behavior changes.
Related reliability work in #3282 and #3443 changes other tests and shared helpers, not these realtime tests. Checked current main and actual file lists of all 138 PRs updated since October 19 for duplication before opening this PR. Merged main at
ddaa6af996ac6fc1debf2828d0eb050ea509b7b8without conflicts; shared async helpers are unchanged by this branch.Tests and Documentation
Validation after merging main:
uv run pytest tests\unit\prompt_target\target\test_realtime_audio.py tests\unit\prompt_target\target\test_realtime_target.py -q --disable-warnings --maxfail=1: 117 passed in 31.55s.uv run ruff check tests\unit\prompt_target\target\test_realtime_audio.py tests\unit\prompt_target\target\test_realtime_target.py: passed.uv run ruff format --check tests\unit\prompt_target\target\test_realtime_audio.py tests\unit\prompt_target\target\test_realtime_target.py: passed, both files already formatted.uv run ty check tests\unit\prompt_target\target\test_realtime_audio.py tests\unit\prompt_target\target\test_realtime_target.py: passed.git diff origin/main...HEAD --check: passed.An earlier in-memory mutation experiment serialized callbacks behind a lock: the concurrency test rejected serialization with the expected watchdog failure, and cleanup left both owned tasks done with no pending tasks. An earlier three-repeat run of both realtime modules passed all 351 cases.
Full repository tests, live-provider integration, and JupyText were not run. Documentation changes are not applicable to this test-only change.