Skip to content

test(flaky): empty_core_leg_does_not_inherit_the_sketch_time asserts an absolute 30ms bound and reds loaded linux runners #2152

Closed

Description

@zackees

Symptom

linux / Check (ubuntu-latest) red on the merge-group run for PR #2146
(run 45026460907,
merge group gh-readonly-queue/main/pr-2146-676287f2, base 676287f2):

test esp32::orchestrator::compile_phases::tests::empty_core_leg_does_not_inherit_the_sketch_time ... FAILED
panicked at crates/fbuild-build-esp/src/esp32/orchestrator/compile_phases_tests.rs:136:5:
an empty core leg must not inherit the sketch's time; got 32.362751ms
test result: FAILED. 264 passed; 1 failed; 6 ignored
[perf-log compile-phases-test] compile-core-variant=93 ms, compile-sketch=93 ms, compile-core=32 ms, total=1379 ms

The merge-group job that ran it lasted wall=1823s ... throttled=3008/17128 periods (18%) throttled_time=2907.7s host_cpu_pressure=13% load=40.15, i.e. an oversubscribed runner.

PR #2146 does not touch fbuild-build-esp (diff = crates/fbuild-toolchain only), and the
same test passed on that PR's own pull_request run 25 minutes earlier — so this is a
wall-clock-dependent assertion, not a regression.

Why it fails

compile_phases_tests.rs:134-137 asserts an absolute wall-clock bound on a leg that
compiles zero translation units:

assert!(
    core_phase < Duration::from_millis(30),
    "an empty core leg must not inherit the sketch's time; got {core_phase:?}"
);

The bug it is guarding has a relative signature: when the empty leg wrongly inherits the
sketch region, compile-core ≈ compile-core-variant ≈ compile-sketch (93/93/93 in the failing
run). On a loaded runner the empty leg's own scheduling cost alone reached 32 ms, so the
absolute 30 ms bound reds a correct build.

Suggested fix (same shape as #1667 / #1678)

Assert the relative property with a wide margin instead of an absolute 30 ms:

  • keep the fake's delay at 60 ms (or raise it, since a per-test +200 ms is cheap), and
  • assert core_phase * 3 < sketch_phase (the inherited-time bug gives 1.0x, the correct code
    gives 0.34x even at 32 ms vs 93 ms), and
  • keep sketch_phase >= 40 ms as the sanity floor so a silently-zero sketch leg cannot
    satisfy the ratio.

Sibling instances

core_leg_is_recorded_independently_of_the_sketch in the same file has the same class of
assertion; it should be checked in the same change. Precedent issues:
#1667 (closed by #1678) and #1222.

Found while driving #2146 to green (fbuild steward).

Activity

  1. added
    bug
    on Nov 22, 2026
  2. zackees commented on Nov 22, 2026

    @zackees
    MemberAuthor

    Fix proposed in #2154: relative core_phase * 3 < sketch_phase with the fake delay raised to 200 ms. Mutation check reproduces the inherited time and fails as intended. This also clears the only red check on PR #2148.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions