Skip to content

fix(ci): serve drain race and danger test timeout - #330

Merged
jkyberneees merged 2 commits into
mainfrom
fix/ci-serve-drain-race
Oct 17, 2026
Merged

jkyberneees merged 2 commits into
mainfrom
fix/ci-serve-drain-race

Conversation

@jkyberneees

Copy link
Copy Markdown
Contributor

Fixes the two failures that turned the test job red on main after #328.

  • Data race in TestRED_WSQueuedMessagesAreByteBounded. handleWS registered in a sync.WaitGroup that the shutdown drain waits on. A handler starting while an earlier drain still waits is an add-from-zero concurrent with Wait, which the race detector reports. A mutex-guarded live counter (liveCounter) replaces it; TestLiveCounter_* covers concurrent add/wait (the same shape on a WaitGroup fails under -race) and wait-until-last-done.
  • internal/danger 10m timeout. The package took 350–600s under -race on CI for identical code. The two slowest checks (prefilter equivalence, compound wrapping monotonicity) run as parallel shards: 390s → 258s locally. The test job passes -timeout 20m for runner variance.

🤖 Generated with Claude Code

jkyberneees and others added 2 commits October 17, 2026 21:56
handleWS registered in a sync.WaitGroup that the shutdown drain waits on.
A handler starting while a drain still waits (a second serve instance in
the same process, as the test suite runs them) is an add-from-zero
concurrent with Wait, which the race detector reports and failed
TestRED_WSQueuedMessagesAreByteBounded on CI. A mutex-guarded live counter
orders both.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ut headroom

internal/danger took 350-600s under -race on CI (identical code, runner
variance) against the default 10m test timeout. The prefilter equivalence
check and the compound wrapping monotonicity check were 170s of a 390s
local run; they now run as parallel shards (390s -> 258s). The test job
also passes -timeout 20m so runner variance cannot fail a green suite.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
odek 0ae630c Commit Preview URL

Branch Preview URL
Oct 17 2026, 08:07 PM

@jkyberneees
jkyberneees merged commit c654e4e into main Oct 17, 2026
10 checks passed
@jkyberneees
jkyberneees deleted the fix/ci-serve-drain-race branch October 17, 2026 20:19
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