Skip to content

ci(parity): retry the PlatformIO half of the ESP32-S3 size check on transient CDN faults - #1958

Merged
zackees merged 1 commit into
mainfrom
agent/parity-transient-retry
Nov 8, 2026
Merged

zackees merged 1 commit into
mainfrom
agent/parity-transient-retry

Conversation

@zackees

@zackees zackees commented Nov 8, 2026

Copy link
Copy Markdown
Member

Why

The nightly ESP32-S3 size parity (#1432) gate turned main red on 2026-11-08 (run
42464103663) with:

PackageException: Got the unrecognized status code '504' when downloaded
https://github.com/pioarduino/platform-espressif32/releases/download/55.03.35/platform-espressif32.zip

That is a GitHub release-asset CDN 504, not a firmware-size regression: the test died at
build_with_platformio's single assert!(output.success()), before the fbuild build and the
size comparison ever ran. The previous 14 nightly runs (2026-10-25 … 2026-11-07) were green.

The outage was live and independent of the repo — re-running the same run failed again in
1 m 55 s, and the scheduled Build Comparison Benchmark (42466790090) could not even install
setup-soldr: release request failed after 4 attempts … HTTP 504.

So a third-party CDN fault, whose only symptom is "download failed", was being reported as a
size-parity failure on the trunk. esp32s3_size_parity fetches the pioarduino platform, the
esp_install tool and the arduino-esp32 framework from GitHub release assets on every run,
so it is exposed to this daily; it had no retry at all. (fbuild's own downloader already retries
5× and reports gave up after 5 attempts — the asymmetry was on the PlatformIO side.)

What

crates/fbuild-build/tests/it/esp32s3_size_parity.rs:

  • is_transient_download_failure(output) — classifies a failure as a transient download/network
    fault (release-CDN 5xx, Connection reset, Read timed out, DNS failure, RemoteDisconnected)
    versus a real build defect.
  • run_with_transient_retry(attempts, backoff, attempt_fn) — the retry policy, extracted so it is
    testable without PlatformIO, a toolchain download or a network fault.
  • build_with_platformio now runs through it with PLATFORMIO_ATTEMPTS = 3 and a
    RETRY_BACKOFF * attempt (30 s, 60 s) backoff, and still uses the same 900 s per-attempt budget
    from audit: blocking operations with no timeout in tests + benches (sub-issue of #802) #806. Compiler errors and .pio failures fail on the first attempt, unchanged.
  • The panic message now names the attempt and says whether the retries were exhausted on a
    transient fault or the build itself failed.

Nothing else changes: same platform pin, same Blink fixture, same fbuild_size <= pio_size
assertion, same workflow.

Tests

soldr cargo test -p fbuild-build --test it esp32s3_size_parity::tests → 7 passed, 0 failed
(real output):

classifies_the_nightly_504_as_transient ... ok
classifies_transport_faults_as_transient ... ok
does_not_retry_a_compiler_error ... ok
does_not_retry_an_unknown_environment ... ok
retries_a_transient_504_and_then_succeeds ... ok      # one retry absorbs the 504
exhausts_the_budget_on_a_persistent_outage ... ok      # bounded: 3 attempts, then a real failure
does_not_retry_a_build_failure ... ok                  # compiler error fails at attempt 1

Classifier inputs include the verbatim 504 string from run 42464103663.

Other gates: soldr fmt --check rc 0; soldr clippy -p fbuild-build --all-targets rc 0 with no
diagnostics in this file; ci/check_test_layout.py ok; ci/enforce_platform_boundary.py --print-totals → rows=44; dylint_rows=43, rc 0 (unchanged).

Not done

  • No change to the #[ignore]d integration body itself — the real two-build comparison still needs
    PlatformIO plus a working CDN, which this host does not have (pio absent; GitHub release assets
    are 504-ing right now). The retry path is proven by the extracted-policy tests, not claimed as an
    end-to-end hardware/network proof.
  • No CI workflow change and no caching of ~/.platformio: a cache key is only safe when the pinned
    platform URL fully determines the contents, and this workflow's cache budget is already under the
    repo ceiling. Left for a separate change if it is wanted.

The nightly ESP32-S3 size-parity gate (run 42464103663) died on a GitHub
release-asset CDN 504 while PlatformIO fetched the pioarduino platform, and
that read as a firmware-size regression on main. The test had one attempt
and treated every non-zero exit as a parity failure.

Classify transient download/network faults (CDN 5xx, connection reset,
timeouts, DNS) and retry them up to PLATFORMIO_ATTEMPTS with a growing
backoff; compiler errors still fail on the first attempt. The retry policy
is extracted as run_with_transient_retry so it is unit-testable without
PlatformIO, a toolchain download or a live network fault.

Per-attempt budget (900 s, #806), platform pin, fixture and the
fbuild_size <= pio_size assertion are unchanged.
@coderabbitai

coderabbitai Bot commented Nov 8, 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
  • 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 commented Nov 8, 2026

Copy link
Copy Markdown
Member Author

Live witness of the retry path, on this branch's head (run 42467904763, 09:36–09:40Z):

test esp32s3_size_parity::... PlatformIO attempt 1/3 failed on a transient download fault; retrying in 30s
PlatformIO attempt 2/3 failed on a transient download fault; retrying in 60s
thread '...' panicked at esp32s3_size_parity.rs:180:5:
PlatformIO build failed (attempt 3/3, exit 1):
PackageException: Got the unrecognized status code '504' when downloaded
https://github.com/pioarduino/platform-espressif32/releases/download/55.03.35/platform-espressif32.zip

So: classification and the retry loop behave exactly as intended against a real fault, and the failure now names the attempt and the URL instead of looking like a size regression.

The same run also shows the honest limit: GitHub's release-asset CDN is intermittently 504-ing for that asset right now (a manual HEAD probe returned 504, 504, 206, 504, 504, 206 over six tries), so three attempts are not always enough during a sustained incident. Every other red check on this PR in the same window is the same fault — setup-soldr: ... HTTP 504 for forge-ci/soldr — including linux / Check, both Inventories and dylint. Those are the outage, not this diff; they will be re-run when the CDN settles.

The structural fix for the download exposure (cache ~/.platformio across nightly runs, or mirror the pinned platform) is deliberately not in this PR — it needs a cache-budget decision under GATE-012 — but it is the only thing that removes the dependency on GitHub's CDN for a nightly gate.

@zackees
zackees added this pull request to the merge queue Nov 8, 2026
Merged via the queue into main with commit 45c70f9 Nov 8, 2026
42 of 51 checks passed
@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Nov 9, 2026
@zackees
zackees deleted the agent/parity-transient-retry branch November 24, 2026 21:36
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.

1 participant