Skip to content

turbo-tasks-backend: remove racy ungated collectibles_outdated_dependency test - #100377

Merged
lukesandberg merged 2 commits into
canaryfrom
fleet/deflake-collectibles-outdated-dependency
Oct 20, 2026
Merged

lukesandberg merged 2 commits into
canaryfrom
fleet/deflake-collectibles-outdated-dependency

Conversation

@lukesandberg

@lukesandberg lukesandberg commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

What?

Removes thecollector_is_not_re_executed_for_collectibles_it_has_not_read_yet test from turbo-tasks-backend's collectibles_outdated_dependency.rs. The other variant (gated_collector_is_not_re_executed_for_collectibles_it_has_not_read_yet) stays, and its behaviour is unchanged.

Why?

The ungated test failed intermittently on canary with take=â€Ķ: executions after the input change (left 2, right 1).

The cause is the race that the module's doc comment already described, not a backend bug. State::set invalidates its readers one by one. When the collector is invalidated before the emitter, it re-executes right away, its strongly consistent read of the still-clean source returns at once, and it reads the old collectibles. When the new collectibles arrive, it re-executes again, as it should. Instrumentation confirmed this in every failure: the extra execution read count=200 but saw 5 collectibles. It reproduced in about 2 of 120 serial release runs under CPU load.

So "exactly one execution" can't be asserted without controlling that order.

I was not very confident about this test when it was added, so dropping it seems reasonable.

â€Ķency test

State invalidates its readers one by one, so the collector could re-execute
and read the still-clean source's old collectibles before the emitter was
invalidated, then legitimately re-execute again. The gated variant stages the
same overlap deterministically.

Co-authored-by: Luke Sandberg <210140+lukesandberg@users.noreply.github.com>
@github-actions

github-actions Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

Tests Passed

Commit: 109bfdb

@github-actions github-actions Bot added created-by: Turbopack team PRs by the Turbopack team. Turbopack Related to Turbopack with Next.js. labels Oct 19, 2026
@lukesandberg
lukesandberg requested a review from a team October 19, 2026 21:00
@lukesandberg
lukesandberg marked this pull request as ready for review October 19, 2026 21:01
@lukesandberg
lukesandberg enabled auto-merge (squash) October 19, 2026 23:47
@lukesandberg
lukesandberg merged commit 58840ec into canary Oct 20, 2026
102 checks passed
@lukesandberg
lukesandberg deleted the fleet/deflake-collectibles-outdated-dependency branch October 20, 2026 00:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

created-by: Turbopack team PRs by the Turbopack team. Turbopack Related to Turbopack with Next.js.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants