Skip to content

fix(backend): correct stale socket-identity assertion in soniox failover test (#20691) - #20693

Merged
kodjima33 merged 1 commit into
mainfrom
watchdog/issue-20691-soniox-replaytailsocket-test
Oct 5, 2026
Merged

kodjima33 merged 1 commit into
mainfrom
watchdog/issue-20691-soniox-replaytailsocket-test

Conversation

@kodjima33

@kodjima33 kodjima33 commented Oct 4, 2026 •

Copy link
Copy Markdown
Collaborator

What changed and why

tests/unit/test_soniox_typed_rejections.py::test_failover_on_a_typed_402_death_opens_the_selection_circuit
has been failing deterministically on every main CI run since #20671
merged (auto-filed tracker: #20691, "Backend unit shards result was
'failure'").

#20671 changed ListenReceiver._pump_replacement (receiver.py) to
always adopt the ReplayTailSocket wrapper on a replacement leg, even
for an empty prefix — per its own comment, exposing the raw paced
writer there stalls receive/disconnect observation behind a buffered
client burst. This one pre-existing test was not updated to match and
kept asserting socket identity against the raw replacement.

Fix

Mirror the already-updated sibling assertions in
test_stt_session_failover.py: assert
isinstance(receiver.stt_socket, ReplayTailSocket) and check
.connection for the underlying raw socket, instead of identity on
stt_socket itself.

Test-only change, no production code touched.

What I tested

  • pytest tests/unit/test_soniox_typed_rejections.py standalone (matches
    how CI shards run each file in its own process): 35 passed, including
    the previously failing test.
  • Confirmed the failure reproduces on origin/main before this change,
    and is gone after.
  • Ran the sibling live-recovery/failover test files standalone too
    (test_stt_session_failover.py, test_live_recovery_matrix.py,
    test_live_recovery_canary_regressions.py,
    test_live_recovery_shutdown_tail.py,
    test_live_replay_provider_pairs.py,
    test_listen_speaker_id_failover.py, test_soniox_idle_close.py) —
    all pass individually. (Running them bundled into one pytest process
    produces unrelated cross-file failures from shared-module state; this
    repo's own CI runs each test file in its own process for exactly that
    reason, so it doesn't apply here.)

🤖 automated by hourly watchdog — tested and merged

Review in cubic

… test

#20671 changed _pump_replacement to always adopt the ReplayTailSocket
wrapper on replacement legs (including empty-prefix ones), per its
receiver.py comment: exposing the raw paced writer stalls
receive/disconnect observation behind a buffered client burst. This
one test in test_soniox_typed_rejections.py was not updated to match
and has asserted receiver.stt_socket is the raw replacement socket
ever since, failing deterministically on every main CI run.

Fix mirrors the already-updated sibling assertions in
test_stt_session_failover.py: assert isinstance(..., ReplayTailSocket)
and check .connection for the underlying raw socket instead of
identity on stt_socket itself.

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Re-trigger cubic

@kodjima33
kodjima33 merged commit cb319af into main Oct 5, 2026
59 checks passed
@kodjima33
kodjima33 deleted the watchdog/issue-20691-soniox-replaytailsocket-test branch October 5, 2026 00:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant