Skip to content

test(esp32): assert the empty core leg relative to the sketch leg - #2154

Merged
zackees merged 1 commit into
mainfrom
agent/flaky-coreleg-relative
Nov 22, 2026
Merged

zackees merged 1 commit into
mainfrom
agent/flaky-coreleg-relative

Conversation

@zackees

@zackees zackees commented Nov 22, 2026

Copy link
Copy Markdown
Member

Why

empty_core_leg_does_not_inherit_the_sketch_time asserted an absolute wall-clock bound
(core_phase < 30 ms) on a leg that compiles zero translation units. On an oversubscribed
runner the empty leg's own scheduling cost alone reached 32.36 ms, so a correct build went
red:

Neither PR touches fbuild-build-esp, so this is a wall-clock-dependent assertion, not a
regression. Filed as #2152.

What

The bug being guarded has a relative signature — when the empty leg wrongly inherits the
sketch region, compile-core ≈ compile-core-variant ≈ compile-sketch. So:

  • raise the SlowCompiler delay for this test 60 ms → 200 ms, giving the ratio a wide margin
    (a per-test +140 ms is cheap),
  • assert core_phase * 3 < sketch_phase instead of the absolute 30 ms,
  • keep sketch_phase >= 40 ms as the sanity floor so a silently-zero sketch leg cannot satisfy
    the ratio.

The sibling core_leg_is_recorded_independently_of_the_sketch keeps its assertions: they are
lower bounds against a sleep-based fake, and a sleep can only be inflated by load, never
shortened, so that class is load-monotone and safe.

Verification (real output)

$ soldr cargo test -p fbuild-build-esp compile_phases
test result: ok. 2 passed; 0 failed; 0 ignored; 0 measured; 269 filtered out; finished in 0.21s

$ soldr cargo fmt --all -- --check   # exit 0

Mutation check — put the inherited time back (perf.record("compile-core", sketch_elapsed)):

thread '...empty_core_leg_does_not_inherit_the_sketch_time' panicked:
an empty core leg must not inherit the sketch's time; got core 202.275902ms vs sketch 202.275902ms
test result: FAILED. 0 passed; 1 failed

The mutation was reverted; the only changed file in this PR is
compile_phases_tests.rs (12 insertions, 4 deletions).

Scope

Test-only. It also unblocks PR #2148, whose only red Check was this flake — #2148 stays a
separate PR and is not touched here.

Fixes #2152

empty_core_leg_does_not_inherit_the_sketch_time asserted an absolute
30 ms bound on a leg that compiles zero TUs. On an oversubscribed
runner the empty leg's own scheduling cost alone reached 32.36 ms, so a
correct build went red (merge group for #2146, run 45026460907, and
again on PR #2148's Check at 23m44s).

The bug this guards has a relative signature: compile-core,
compile-core-variant and compile-sketch all land on the same value. So
assert the ratio instead (core * 3 < sketch) and raise the fake
compiler's delay to 200 ms so the margin is wide.

Mutating the production call back to sketch_elapsed reproduces the
inherited time exactly (core 202.28 ms vs sketch 202.28 ms) and the new
assertion fails, so the guard still has teeth.
@coderabbitai

coderabbitai Bot commented Nov 22, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review

Note

.coderabbit.yaml has unrecognized properties

CodeRabbit is using all valid settings from your configuration. Unrecognized properties (listed below) have been ignored and may indicate typos or deprecated fields that can be removed.

Parsing warnings: 1

Validation error: Unrecognized key: "enabled" at "reviews.pre_merge_checks"
Configuration instructions

  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@zackees
zackees added this pull request to the merge queue Nov 22, 2026
Merged via the queue into main with commit d47a877 Nov 22, 2026
32 checks passed
@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Triage

Development

Successfully merging this pull request may close these issues.

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

1 participant