Skip to content

Fix flakiness in cluster-test - #8187

Merged
ry merged 2 commits into
mainfrom
ry/cluster-test-time
Nov 3, 2026
Merged

ry merged 2 commits into
mainfrom
ry/cluster-test-time

Conversation

@ry

@ry ry commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

#8162 cut seeds in the cluster simulations (//src/workerd/server/cluster:cluster_test), but the timeouts are in the integration test, tests/cluster:cluster-test. The flakiness is a timeout, not a race: in a failing run, all 22 tests
that ran passed, in 239.9 s, before a 240 s timeout killed it. Seven tests SIGKILL an owner and wait out its 20 s lease. This removes five of them, and the alarm test polls instead of sleeping 30 s.

What's lost: facet clones, nested deletions and deleteAll() across a real takeover, and alarm adoption after a dead owner's record is gone. The simulations (owner-test.rs, capture-test.rs, alarms-test.rs) already search these over many seeds; only the real binary's wiring goes untested. The remaining takeover test now carries facets and a deletion across, so the common path is still covered end to end. The file header lists the gaps.

Measured with this change: 136.7 s on the downstream build that hit the timeout (was >240 s), 153.9 s under tsan on CI.

cluster-test ran out of time downstream, where "eternal" is capped at
240 s: all 22 tests that ran passed, in 239.9 s, before the cap killed
it. Seven of its tests wait out a dead owner's 20 s lease. Five check
cases the simulations already search (owner-test.rs, capture-test.rs,
alarms-test.rs); remove them and keep one takeover per mechanism. The
remaining takeover test now carries facets and a deletion across, and
the killed-owner alarm test polls instead of sleeping 30 s.

Not covered through a real binary any more: facet clones, nested
deletions and deleteAll() across a takeover, and alarm adoption after
the dead owner's node record is gone. The file header lists them.
@ry
ry marked this pull request as ready for review November 3, 2026 15:27
@ry
ry requested review from a team as code owners November 3, 2026 15:27

@clanky-the-clanker clanky-the-clanker 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.

Superseded by the review of 335928a6.

This review, of d7c56b0b

✅ Approved — This is a test-only change that cuts lease-bound takeover tests and replaces a fixed sleep with a bounded poll. The remaining assertions match the removed tests, and no issues were found.

The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.


✅ All checks passed

🔒 Security: ✅ LGTM

This is a test-only change with no security impact.


📖 AGENTS.md: ✅ LGTM

These test-only changes do not need an AGENTS.md update.


📋 Code Quality: ✅ LGTM

The facet assertions moved into the takeover test match the removed test's expected counts. The alarm-test polling loop is bounded and asserts on timeout. The removed worker routes are not used anywhere else.


⚡ Performance: ✅ LGTM

The change shortens the test's runtime by removing five lease waits and a fixed 30 s sleep.


📝 Documentation: ✅ LGTM

The file header and the BUILD comment describe the remaining coverage accurately.


Reviewed commit: d7c56b0b

@ry
ry enabled auto-merge (squash) November 3, 2026 15:34

@clanky-the-clanker clanky-the-clanker 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.

✅ Approved — This is a test-only change that cuts lease-bound takeover tests and replaces a fixed sleep with a bounded poll. The remaining assertions match the removed tests, and no issues were found.

The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.


✅ All checks passed

🔒 Security: ✅ LGTM

This is a test-only change with no security impact.


📖 AGENTS.md: ✅ LGTM

These test-only changes do not need an AGENTS.md update.


📋 Code Quality: ✅ LGTM

The facet assertions moved into the takeover test match the removed test's expected counts. The alarm-test polling loop is bounded and asserts on timeout. The removed worker routes are not used anywhere else.


⚡ Performance: ✅ LGTM

The change shortens the test's runtime by removing five lease waits and a fixed 30 s sleep.


📝 Documentation: ✅ LGTM

The file header and the BUILD comment describe the remaining coverage accurately.


Reviewed commit: 335928a6 — same changes as d7c56b0b, so this is that commit's review (no new review was run; line numbers are as of d7c56b0b)

@ry
ry merged commit 1336872 into main Nov 3, 2026
49 of 51 checks passed
@ry
ry deleted the ry/cluster-test-time branch November 3, 2026 16:45
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.

3 participants