Skip to content

test(tier3): start bridge worker-count tests from an idle server - #358

Merged
rng1995 merged 1 commit into
mainfrom
naren/fix-bridge-worker-count-flake
Nov 6, 2026
Merged

rng1995 merged 1 commit into
mainfrom
naren/fix-bridge-worker-count-flake

Conversation

@rng1995

@rng1995 rng1995 commented Nov 6, 2026

Copy link
Copy Markdown
Collaborator

test_slow_drip_request_line_and_headers_obey_an_absolute_deadline fails intermittently in CI with assert 2 == 1 on bridge_server.active_workers. It hit #306 (Python 3.14) and #344 (Python 3.13, job 127575481748), and it is unrelated to either change.

Cause

The bridge_services fixture probes /healthz until the bridge answers. urllib returns once it has read the response, but the server-side worker thread is still in its finally block and has not yet decremented active_workers. Under xdist and coverage load, a test can start while that probe worker is still counted. The slow-drip test then sees it alongside its own connection and gets 2 workers instead of 1.

Fix

Before yielding, the fixture waits for the bridge to go idle with the existing wait_for_workers(timeout=2). Only the test fixture changes.

Evidence

  • In a throwaway copy, I added a 0.2 s delay before the worker count drops and a test that asserts the fixture hands over an idle server. Without this change that test fails with assert 1 == 0; with it, the test passes.
  • tests/test_nvidia_build_bridge.py: 134 passed.

🤖 Generated with Claude Code

The bridge_services fixture probes /healthz until the bridge answers. The
probe's server worker can still be finishing after urllib has read the
response, so under CI load a test could start with one worker already
active. test_slow_drip_request_line_and_headers_obey_an_absolute_deadline
then counted that worker next to its own connection and failed with
'assert 2 == 1' (seen on PRs #306 and #344). Wait for the bridge's workers
to drain before yielding the fixture.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Narendran Raghavan <[email protected]>
@rng1995
rng1995 enabled auto-merge (squash) November 6, 2026 03:21
@rng1995
rng1995 merged commit 57f899a into main Nov 6, 2026
19 checks passed
@rng1995
rng1995 deleted the naren/fix-bridge-worker-count-flake branch November 6, 2026 03:46
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