Repository navigation
test(cli): HIL proof the daemon survives a real ESP32-C6 full flash (#1329 AC5) - #2011
Merged
Merged
Conversation
…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.
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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_recoverytest (sametests/itmodule, 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-proofser=<usb serial>selectorFBUILD_HIL_ENVIRONMENT— defaults toesp32c6It brings a daemon up on an isolated
FBUILD_DAEMON_PORTover 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 fullfbuild deploybuild+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 asMissing, 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)Daemon log for the same run — the flash really went through the external esptool path that #1329 is about:
An earlier run in this session also took the full-flash path (
285756bytes) with daemon pid4042668stable 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 ignoredsoldr cargo test -p fbuild-cli --test it -- daemon_crash_recovery::classify_deploy_output→ 1 passedsoldr cargo fmt --check -p fbuild-cli→ cleansoldr cargo clippy -p fbuild-cli --tests --no-deps -- -A unfulfilled_lint_expectations→ cleanuv run python ci/enforce_platform_boundary.py --print-totals→rows=44; dylint_rows=43, rc 0Not 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
deferreduntil 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.