Repository navigation
test(channels): give the Telegram polling test a 30 s ceiling - #483
Merged
itsskofficial merged 1 commit intoOct 21, 2026
Conversation
ShryukGrandhi
requested review from
Kabeer2004 and
itsskofficial
as code owners
October 20, 2026 08:33
5 tasks done
itsskofficial
approved these changes
Oct 21, 2026
itsskofficial
left a comment
Contributor
There was a problem hiding this comment.
Thanks @ShryukGrandhi! Letting the loop end itself on the revoked token, with a generous ceiling only as a hang guard, is exactly what our flaky-test policy recommends, and removing the marker in the same PR is spot on. I ran it 50 times quiet, 35 times next to the full suite and 64 times at 16 at once, all green. Approving and merging.
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.
What and why
test_polling_backoff_recovery_and_revoked_tokengave the whole Telegram polling loop 5 seconds of wall-clock time: six scriptedgetUpdatesreplies, four backoffs (fake sleep), one dispatched update and the stop on the 401, each with its own SQLite commits. On a busy Windows runner with-n autothat budget ran out while the loop was waiting on anaiosqlitecommit, so the test failed even though the logic was fine.The loop ends by itself on the revoked token, so the limit is only a guard against a hang. This raises it to 30 s, the same ceiling
until()intests/channels/conftest.pyalready uses, and removes the@pytest.mark.flaky(reruns=2)marker that was added as a stopgap.Fixes #420
How I tested it
aiosqlite.Connection.commit(standing in for a busy CI worker), with reruns turned off:PYTHONPATH=/tmp/slowsql420 .venv/bin/python -m pytest -q tests/channels/test_telegram.py -k polling_backoff -p slowsql -p no:rerunfailuresTimeoutErrorat 5.00 s, same as the CI run.venv/bin/python -m pytest -q tests/channels -p no:rerunfailures: 154 passed, 1 skipped. On one earlier runtest_voice_note_is_transcribed_and_answeredfailed once. It passed on its own and on the next full run, and this change doesn't touch it..venv/bin/ruff check sentient tests packaging: cleanReal test
Test-only change, no model involved. The evidence is the slowed-commit reproduction above, which fails the old 5 s limit and passes the new one. No changelog entry because users won't notice this change.
Checklist
pytest/npm run typecheckpass locally for what I touchedruff check sentient testsis cleandocs/API.mdupdated if the desktop ↔ engine contract changed (n/a)changes/if users will notice this change (n/a, test only)Summary by CodeRabbit