Repository navigation
Fix flakiness in cluster-test - #8187
Conversation
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.
There was a problem hiding this comment.
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
There was a problem hiding this comment.
✅ 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)
#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 teststhat 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.