Repository navigation
test(channels): wait for the sendVoice reply in the voice note test - #549
Conversation
|
All contributors have signed the CLA ✍️ ✅ |
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Wait for the voice reply tests/channels/test_telegram.py |
The test waits for a recorded sendVoice call before it checks the voice payload and confirms that no sendAudio call occurred. |
Estimated code review effort: 1 (Trivial) | ~3 minutes
Change: Other · Severity of issue fixed: Low
Suggested labels: area: channels
Suggested reviewers: itsskofficial, kabeer2004
Merge Risk: 
Minimal · up to b7819
-
The test now waits for the voice reply without weakening its payload checks. No actionable merge-blocking risk was identified.
Pre-merge checks: 
4 · 
1
-
Failed checks: 1 warning Passed checks: 4 passed-
Full details: Title check
-
Explanation
The title names the change correctly. The PR makes the voice-note test wait for a sendVoice call before it asserts, and the title says the same. It uses the conventional test(channels) prefix and stays specific to the sendVoice reply in the voice note test.
Full details: Linked Issues check
-
Explanation
Issue
#546requires a bounded wait for the asynchronoussendVoicecall intests/channels/test_telegram.py::test_voice_note_is_transcribed_and_answered. The PR adds the existinguntilhelper with a 30-second bound before thesendVoiceassertions. The reported channel tests, lint checks, and repeated test runs support the change.
Full details: Out of Scope Changes check
-
Explanation
The PR changes only the timing of the
sendVoiceassertion in the test named by issue#546. The payload andsendAudioassertions remain unchanged. No unrelated behavior or production code changes are reported.
-
Full details: Docstring Coverage
-
Explanation
Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 1 files.
Resolution
Write docstrings for the functions missing them to satisfy the coverage threshold.
-
Finishing Touches
-
Generate unit tests (beta)
-
- Create a new PR
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
A rabbit waits while voice calls land
Then checks the payload, neat and grand
No audio call slips past the test
The voice reply gets checked with care
And floppy ears applaud the fix
|
I have read the CLA Document and I hereby sign the CLA |
|
recheck |
itsskofficial
left a comment
There was a problem hiding this comment.
Welcome to Sentient, @PruthviRajSolase, and thank you! This is a small, correct fix and I found nothing to change. Approving.
Why it works. The voice reply is sent inside the turn, but wait_idle() gives up silently after 10 s. On a loaded machine the test could therefore reach the assertion before sendVoice happened. Your until(...) polls against a 30 s deadline and raises AssertionError when it runs out, so it waits longer but doesn't hide a failure.
Checked on the voice test, by changing only the audio conversion from a throwaway pytest plugin (repo code untouched):
| Reply | main | This branch |
|---|---|---|
| Normal (0.2 s delay) | pass | pass |
Takes 12 s, past wait_idle's 10 s (reproduces #546) |
fails, assert 0 == 1 |
pass |
| Never sent | fails, assert 0 == 1 |
fails at the deadline, condition not met in time |
Conversion breaks, falls back to sendAudio |
fails, assert 0 == 1 |
fails at the deadline, condition not met in time |
Under load. pytest tests/channels -n auto on 16 cores ran 20 times in a row on Windows: 20 of 20 passed, 167 tests each, nothing skipped. A local model was running at the same time for part of this, which stretched two runs to 15 and 5.5 minutes. They passed too.
There's no flaky marker on this test and you didn't add one, so nothing needs removing. CI and the CLA are green, there are no review threads, and no changelog entry is needed for a test-only change.
One optional thought for a future PR: test_voice_note_in_and_voice_note_out in tests/channels/test_whatsapp.py looks like the same pattern, with some leftover debug prints. It isn't part of this PR.
29adbd7
Closes #546
The spoken reply (
voice_replies = True) is sent after the text reply, but the test asserted onsendVoiceright aftertg.say(...)returned. Under load the call hadn't landed yet, solen(voices) == 1failed.The test now waits for the
sendVoicecall with the existinguntilhelper (bounded at 30 s) before asserting. No behaviour change; the assertions that follow are unchanged.Checked:
pytest tests/channelspasses (163 passed, 1 skipped)ruff check sentient testspassesSummary by CodeRabbit