fix(tests): e2e group-restart test no longer flakes on cold SessionDB init (#92130) - #94407
Merged
Merged
Conversation
… init The /goal post-turn hook constructs a real SessionDB on an executor thread at the turn boundary. On a cold or loaded CI runner that state.db init can exceed send_and_capture's 2s poll window, so the send lands after the assertion and the test reports the bare 'Expected mock to have been called once. Called 0 times.' (#92130). Mock _run_post_turn_hooks in the e2e runner — these tests exercise gateway command dispatch, not goal hooks. Also scrub TELEGRAM_GROUP_ALLOWED_CHATS / *_GROUP_ALLOWED_USERS / QQ allowlist env vars in the hermetic conftest: a developer shell with those set flips _get_unauthorized_dm_behavior to 'ignore' and fails the pairing e2e test locally.
Contributor
૮ >ﻌ< ა ci reviewran on 7433743 — fix(tests): e2e group-restart test no longer flakes on cold
|
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.
Summary
The e2e group-restart test no longer fails CI with the bare "Expected 'mock' to have been called once. Called 0 times." — the flake tracked in #92130 that hit unrelated PRs (#89118, #92058, #94388) and two main runs tonight.
Root cause: the e2e runner fixture left
GatewayRunner._run_post_turn_hooksreal. That path runs the /goal continuation, whose SessionDB warm-up constructs a REALSessionDBon an executor thread at the turn boundary. On a cold or loaded CI runner that state.db init exceedssend_and_capture's 2s poll window, so the send lands after the assertion. Proven by sabotage A/B: injecting a 3sSessionDB.__init__delay reproduces the exact CI failure deterministically on current main, and passes with this fix.Changes
tests/e2e/conftest.py: mock_run_post_turn_hooksin the e2e runner — these tests exercise gateway command dispatch, not post-turn goal hookstests/conftest.py: scrubTELEGRAM_GROUP_ALLOWED_USERS/TELEGRAM_GROUP_ALLOWED_CHATS/QQ_ALLOWED_USERS/QQ_GROUP_ALLOWED_USERSin the hermetic env — a developer shell with a group allowlist set flips_get_unauthorized_dm_behaviorto "ignore" and deterministically fails the pairing e2e test locally (the per-user vars were already scrubbed; the group vars checked byauthz_mixin.pywere not)Validation
tests/e2e/full directory ×3 (shell hasTELEGRAM_GROUP_ALLOWED_CHATSset)Related: #92130 (diagnostics-only PR by @mehmetkr-31 — complementary, this PR fixes the flake itself).
Infographic