Skip to content

test(channels): wait for the sendVoice reply in the voice note test - #549

Open
PruthviRajSolase wants to merge 1 commit into
existence-master:mainfrom
PruthviRajSolase:fix/telegram-voice-test-flaky
Open

PruthviRajSolase wants to merge 1 commit into
existence-master:mainfrom
PruthviRajSolase:fix/telegram-voice-test-flaky

Conversation

@PruthviRajSolase

@PruthviRajSolase PruthviRajSolase commented Nov 2, 2026 •

Copy link
Copy Markdown

Closes #546

The spoken reply (voice_replies = True) is sent after the text reply, but the test asserted on sendVoice right after tg.say(...) returned. Under load the call hadn't landed yet, so len(voices) == 1 failed.

The test now waits for the sendVoice call with the existing until helper (bounded at 30 s) before asserting. No behaviour change; the assertions that follow are unchanged.

Checked:

  • pytest tests/channels passes (163 passed, 1 skipped)
  • ruff check sentient tests passes
  • the test passed 15/15 repeated runs

Summary by CodeRabbit

  • Tests
    • Updated a voice-reply test to wait for the voice message to be recorded before checking its file payload and confirming no audio message was sent.

@github-actions

github-actions Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

All contributors have signed the CLA ✍️ ✅
Posted by the CLA Assistant Lite bot.

@coderabbitai

coderabbitai Bot commented Nov 2, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7a9f13d8-3124-43ac-8fc1-e4487515694d
Commits

Reviewing files that changed from the base of the PR and between 2a3f848 and b781909.

Files selected for processing: 1
  • tests/channels/test_telegram.py

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.

Walkthrough

The Telegram voice-reply test now waits for a recorded sendVoice call before it checks the voice payload and confirms that sendAudio was not called.

Changes: Telegram voice-reply test

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: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning 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. Documentat… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed 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 stay…
Linked Issues check Passed Issue #546 requires a bounded wait for the asynchronous sendVoice call in tests/channels/test_telegram.py::test_voice_note_is_transcribed_and_answered. The PR adds the existing until helper with…
Out of Scope Changes check Passed The PR changes only the timing of the sendVoice assertion in the test named by issue #546. The payload and sendAudio assertions remain unchanged. No unrelated behavior or production code changes a…
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 #546 requires a bounded wait for the asynchronous sendVoice call in tests/channels/test_telegram.py::test_voice_note_is_transcribed_and_answered. The PR adds the existing until helper with a 30-second bound before the sendVoice assertions. 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 sendVoice assertion in the test named by issue #546. The payload and sendAudio assertions 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.

Share

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

@github-actions github-actions Bot added the area: channels Telegram, Discord label Nov 2, 2026
@PruthviRajSolase

Copy link
Copy Markdown
Author

I have read the CLA Document and I hereby sign the CLA

github-actions Bot added a commit that referenced this pull request Nov 2, 2026
@PruthviRajSolase

Copy link
Copy Markdown
Author

recheck

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: channels Telegram, Discord

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Flaky: test_voice_note_is_transcribed_and_answered misses the sendVoice reply under load

1 participant