Repository navigation
tests: speed up the unit suite and fold per-PR test files - #8510
Merged
Merged
Conversation
The unit gate grew from about 1 min to 8 min on CI because most new async tests waited on the real clock: sleeps, timeouts, retry backoff and close delays. Timing-driven tests now run on virtual time, real servers give way to in-memory fakes where possible, and the remaining real-time tests use short timeouts and events instead of sleeps. Per-PR test files are folded into one module per unit under test, near-duplicates become parametrized tests, and tests already covered by another test are deleted. The two tests that reached the network (a tiktoken download, a real inference.LLM call) are gone or hermetic. virtual_time also patches time.time_ns and the OpenTelemetry span clock, and keeps the default-executor shutdown on real time. AGENTS.md states where a new test goes and that unit tests stay off the network and the real clock.
chenghao-mou
approved these changes
Nov 11, 2026
neil-sarvam
added a commit
to neil-sarvam/agents
that referenced
this pull request
Nov 11, 2026
Fold the end-of-input tests into tests/test_plugin_sarvam_stt.py, following livekit#8510, and re-anchor the provider clock with restart_provider_clock() on reconnect, following livekit#7795. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
neil-sarvam
added a commit
to neil-sarvam/agents
that referenced
this pull request
Nov 11, 2026
Fold the end-of-input tests into tests/test_plugin_sarvam_stt.py, following livekit#8510. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
neil-sarvam
added a commit
to neil-sarvam/agents
that referenced
this pull request
Nov 11, 2026
Fold the reconnect tests into the reorganized tests/test_plugin_sarvam_stt.py, following livekit#8510, and re-anchor the provider clock with restart_provider_clock() on reconnect, following livekit#7795. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
neil-sarvam
added a commit
to neil-sarvam/agents
that referenced
this pull request
Nov 11, 2026
Move the timestamp tests into the reorganized tests/test_plugin_sarvam_stt.py, following livekit#8510. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kimnamu
added a commit
to kimnamu/agents
that referenced
this pull request
Nov 11, 2026
Resolve the comment conflict in tests/test_plugin_aws_llm.py by keeping the comment style from livekit#8510 and adding the Sonnet 5.5 / Sonnet 5 mention. Co-Authored-By: Claude <noreply@anthropic.com>
Rehansanjay
added a commit
to Rehansanjay/agents
that referenced
this pull request
Nov 12, 2026
…ime_turns.py Upstream folded the per-PR test files (livekit#8510), deleting test_playout_launch_pause.py and test_realtime_reply_chat_ctx.py. The six hold_reply_while_user_speaking tests now sit at the end of test_playback.py, and the _waits_for_user_silence stub moves to the realtime reply fake in test_realtime_turns.py.
chenghao-mou
added a commit
to sarankumar1325/agents
that referenced
this pull request
Nov 12, 2026
main folded tests/test_amd_detector.py into tests/test_amd.py (livekit#8510). The hangup tests and their fake room move there. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
chenghao-mou
added a commit
that referenced
this pull request
Nov 12, 2026
…6-mini-2s-eot-model #8510 folded tests/test_turn_detection_fsm.py and tests/test_speech_start_time_persistence.py into tests/test_turn_detector.py and tests/test_audio_recognition.py. The tests this branch added to the deleted files move there, and tests/test_audio_eot_local_transport.py folds into tests/test_turn_detector.py to follow the same layout. The folded request tests asserted on the transport right after predict(). The request now waits in the audio queue, so their scripted transport drains it. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This was referenced Nov 12, 2026
peirangong-baseten
added a commit
to peirangong-baseten/agents
that referenced
this pull request
Nov 12, 2026
Conflict in tests/test_plugin_baseten_stt.py: main (livekit#8510) moved the Whisper tests onto an in-process FakeWebSocket under virtual time. The v2 tests are moved the same way, since a real local server times out on the virtual clock: the fake server now answers each event as the client sends it, and its segment times count the socket's own audio. main (livekit#7796) also re-anchors start_time_offset on the first frame each connection reads. A reconnected v2 socket's clock starts at the replayed audio, before that frame, so the stream now uses the live offset only until its first reconnect after reading audio, and keeps that anchor from then on. The offset test starts its audio 1 s after the offset is set and fails both with the anchor read at connect time and with the live offset throughout. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
chenghao-mou
added a commit
that referenced
this pull request
Nov 13, 2026
main folded per-PR test files (#8510) and fixed callee hangups in the old AMD classifier (#8242). This branch replaces that classifier, and its detector already completes with reason participant_disconnected, so the old classifier.py and main's tests/test_amd.py are dropped. The branch's edits to the folded test files move to tests/test_audio_recognition.py and tests/test_agent_interruptions.py.
chenghao-mou
added a commit
that referenced
this pull request
Nov 13, 2026
main now keeps one test module per source module (#8510). The nine tests/test_amd_*.py files and tests/amd_test_utils.py become regions of tests/test_amd.py. The realtime session helper is now running_realtime, because the detector tests already define running.
chenghao-mou
added a commit
that referenced
this pull request
Nov 13, 2026
…nto chenghao/feat/AGT-3866-amd-client-feature The base branch merged main, which folded the per-PR test files (#8510) and dropped tests/test_inference_stt_start_of_speech.py. The one-line edit this branch made to that file goes with it: the test it touched no longer exists.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem: The
unit-testsCI job grew from about 1 min in July to 8 min, because most new async tests wait on the real clock through sleeps, timeouts, retry backoff and close delays. The suite also grew from about 90 to 357 files, mostly one file per PR, with copied fakes and tests that repeat what another test already covers.Fix: Timing-driven tests now run under
virtual_time, real servers give way to in-memory fakes where possible, and the tests that still need real time use short timeouts and events. Per-PR files are folded into one module per unit under test, near-duplicates become parametrized tests, and a test is deleted only when another test still covers its behavior.Context for reviewing and coding agents