Skip to content

test(cli): HIL proof the daemon survives a real ESP32-C6 full flash (#1329 AC5) - #2011

Merged
zackees merged 1 commit into
mainfrom
agent/1329-ac5-hil-daemon-pid
Nov 13, 2026
Merged

zackees merged 1 commit into
mainfrom
agent/1329-ac5-hil-daemon-pid

Conversation

@zackees

@zackees zackees commented Nov 13, 2026

Copy link
Copy Markdown
Member

What

Adds the hardware half of #1329's acceptance criteria: AC5 — "an ignored ESP32-C6 HIL full-flash test. Record the daemon PID before and after the exact deploy; it must remain stable, and success/failure must be explicit at the client."

The test lives beside the existing real-process daemon_crash_recovery test (same tests/it module, so it reuses that module's daemon helpers rather than duplicating them).

Design

  • daemon_survives_full_flash — #[ignore]d, driven entirely by env:
    • FBUILD_HIL_PROJECT_DIR — sketch dir (e.g. tests/platform/esp32c6)
    • FBUILD_HIL_PORT — node path (COM9, /dev/ttyACM0) or the renumber-proof ser=<usb serial> selector
    • FBUILD_HIL_ENVIRONMENT — defaults to esp32c6
      It brings a daemon up on an isolated FBUILD_DAEMON_PORT over the ambient cache root (a warm toolchain cache is the point; only the endpoint is isolated so the test can never talk to a daemon it did not spawn), runs the full fbuild deploy build+flash, asserts the daemon pid is unchanged and alive afterwards, and stops the daemon it spawned. It skips (never fails) when a daemon it does not own already holds the root.
  • classify_deploy_output — pure classifier for the AC5 "explicit outcome" contract: a green exit with no success line counts as Missing, exactly like a silent drop, so the test cannot pass vacuously. Unit-tested (7 assertions) so the contract is enforced in CI even though the HIL test is ignored.

Real hardware proof (attached ESP32-C6, USB-JTAG ser=8C:BF:EA:CF:87:B4)

test daemon_crash_recovery::daemon_survives_full_flash ... ok
test result: ok. 1 passed; 0 failed; 0 ignored

[hil] deploying …/hilproj -e esp32c6 -p ser=8C:BF:EA:CF:87:B4 (daemon pid 4086018)
[hil] deploy exit_ok=true in 12.234389132s
[hil] client outcome: Success("Hash of data verified.")
Writing '…/.fbuild/build/esp32c6/release/firmware.bin' at 0x00010000...
Flash will be erased from 0x00010000 to 0x00058fff...
Compressed 297024 bytes to 161852...
Wrote 297024 bytes (161852 compressed) at 0x00010000 in 2.1 seconds (1110.1 kbit/s).
Verifying written data...
Hash of data verified.
Hard resetting via RTS pin...
deploy succeeded (full flash); FBUILD_DEPLOY_PORT=/dev/ttyACM0

Daemon log for the same run — the flash really went through the external esptool path that #1329 is about:

verify-flash: device image differs; proceeding with full flash port="/dev/ttyACM0"
fbuild_deploy::esp32::deployer: flashing …/firmware.bin to /dev/ttyACM0 via esptool (esp32c6)

An earlier run in this session also took the full-flash path (285756 bytes) with daemon pid 4042668 stable across it. In both runs the pid after the flash equals the pid before it, and the client printed an explicit outcome.

Gates

  • soldr cargo test -p fbuild-cli --test it → 11 passed; 0 failed; 2 ignored
  • soldr cargo test -p fbuild-cli --test it -- daemon_crash_recovery::classify_deploy_output → 1 passed
  • soldr cargo fmt --check -p fbuild-cli → clean
  • soldr cargo clippy -p fbuild-cli --tests --no-deps -- -A unfulfilled_lint_expectations → clean
  • uv run python ci/enforce_platform_boundary.py --print-totals → rows=44; dylint_rows=43, rc 0

Not claimed

This does not close #1329: the remaining cells are the Windows COM9 HIL run of exactly this test plus AC6's Windows half. The issue stays deferred until a Windows HIL host exists. One caveat found while running this: a flash+reset renumbers the USB-CDC endpoint (ACM0 → ACM1), so the Windows run should use -p ser=<usb serial> — the test accepts that form.

…ash (#1329 AC5)

#1329's acceptance criteria 1-4 are covered by the deterministic containment
tests in `fbuild-deploy` (esp32::deployer_containment_tests). AC5 asks for the
hardware half: an ignored ESP32-C6 HIL full-flash test that records the daemon
pid before and after the exact deploy, requires it to stay stable, and requires
the client to report an explicit success or failure.

Adds, next to the existing real-process crash-recovery test (so it reuses its
helpers instead of duplicating them):

- `daemon_survives_full_flash`, `#[ignore]`d, driven by FBUILD_HIL_PROJECT_DIR /
  FBUILD_HIL_PORT (node path or the renumber-proof `ser=<usb serial>` selector) /
  FBUILD_HIL_ENVIRONMENT. It brings a daemon up on an isolated FBUILD_DAEMON_PORT
  over the AMBIENT cache root (a warm toolchain cache is the point; only the
  endpoint is isolated), runs the whole `fbuild deploy` build+flash, asserts a
  stable daemon pid across it, and stops the daemon it spawned.
- `classify_deploy_output`, a pure classifier for the AC5 "explicit outcome"
  contract: a green exit with no success line is treated exactly like a silent
  drop (the #1329 defect), so the test fails rather than passing vacuously.
- Unit coverage for that classifier, so the contract is checked in CI even
  though the HIL test itself is ignored.
@coderabbitai

coderabbitai Bot commented Nov 13, 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 added this pull request to the merge queue Nov 13, 2026
Merged via the queue into main with commit 00bfaeb Nov 13, 2026
29 checks passed
@fastled-project-sync fastled-project-sync Bot moved this to Triage in FastLED Tracker Nov 14, 2026
@zackees
zackees deleted the agent/1329-ac5-hil-daemon-pid branch November 24, 2026 21:35
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.

fix(deploy): keep daemon alive and surface diagnostics when ESP32-C6 esptool flash aborts

1 participant