Skip to content

fix(test): deflake ensure_warm parallel-promote timing assertion - #562

Merged
githubrobbi merged 1 commit into
mainfrom
fix/deflake-ensure-warm-parallel-timing
Jul 14, 2026
Merged

fix(test): deflake ensure_warm parallel-promote timing assertion#562
githubrobbi merged 1 commit into
mainfrom
fix/deflake-ensure-warm-parallel-timing

Conversation

@githubrobbi

Copy link
Copy Markdown
Collaborator

Problem

index::tests::ensure_warm::ensure_warm_for_dispatch_promotes_in_parallel flaked on the Windows merge-queue runner and ejected release PR #560 from the queue (panic at ensure_warm.rs:328).

The test made two parallelism assertions:

  1. loader.peak() >= 2 — deterministic: the SlowBodyLoader records peak concurrent in-flight load() calls; a parallel fan-out sees ≥ 2, a serial loop sees 1.
  2. elapsed < 1.5 × delay (150 ms) — a wall-clock proxy.

On a cold/contended runner (the nightly-2026-07-14 cache miss + tokio blocking-pool ramp-up), assertion 2 blew its bound even when the fan-out ran correctly in parallel — a timing race, not a real regression.

Fix

Drop the redundant wall-clock assertion; keep the deterministic peak-in-flight counter, which already pins the parallelism contract (a serial re-promote loop can never exceed peak 1). No production code changed — test-only.

Verified locally: cargo nextest run -p uffs-daemon ensure_warm_for_dispatch_promotes_in_parallel → passes (0.13s).

ensure_warm_for_dispatch_promotes_in_parallel asserted both
loader.peak() >= 2 (deterministic: concurrent loads observed) and
elapsed < 1.5x delay (a wall-clock proxy). The wall-clock bound flaked
on cold/contended CI runners (notably Windows, where the
nightly-2026-07-14 cache miss plus blocking-pool ramp-up pushed even a
correct parallel run past 150ms), which ejected release PR #560 from
the merge queue.

The peak-in-flight counter already proves the parallelism contract with
no timing race: a serial re-promote loop never exceeds peak 1. Drop the
redundant wall-clock assertion and rely on the deterministic signal.
@githubrobbi
githubrobbi enabled auto-merge July 14, 2026 17:23
@githubrobbi
githubrobbi added this pull request to the merge queue Jul 14, 2026
Merged via the queue into main with commit 8b1c74b Jul 14, 2026
21 checks passed
@githubrobbi
githubrobbi deleted the fix/deflake-ensure-warm-parallel-timing branch July 14, 2026 17:54
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