Skip to content

test(e2e-real): watchdog thermal-hold leg — first live coverage (#349) - #384

Merged
VijitSingh97 merged 3 commits into
developfrom
fix/349-e2e-watchdog-overheat
Aug 21, 2026
Merged

test(e2e-real): watchdog thermal-hold leg — first live coverage (#349)#384
VijitSingh97 merged 3 commits into
developfrom
fix/349-e2e-watchdog-overheat

Conversation

@VijitSingh97

Copy link
Copy Markdown
Contributor

Closes #349.

Adds a watchdog phase to tests/e2e-real.sh (also wired into all, between upgrade and perf): the thermal-hold path run for real for the first time — tests/run.sh drives watchdog() entirely through stubs, so the over-temp stop had never fired against a real sensor, a real systemd, or a real miner.

The leg: snapshot config.json and install the cleanup trap FIRST; read the live temperature via the same _read_temp the verb itself calls (so the leg can never disagree with the verb about "the current reading"); lower max_temp_c to 5°C below it through the normal apply path; run rigforge.sh watchdog once; assert three independent witnesses — the over-temp stop log line, the thermal-hold marker file, and a stop/deactivate entry in the systemd journal. Cleanup restores the config snapshot, removes thermal-hold/strike state directly (a config restore alone could leave a stale hold), re-applies, and verifies the service is active — on every exit path. Skips explicitly (never silently) when no temperature reading is available, or when the rig idles too close to the 40°C schema floor for a safe margin. The wedge-restart half stays stubbed-only by design: forcing an unreachable API on a shared rig is the "stranded miner" risk the file already declines elsewhere (#276).

rigforge.sh: zero changed lines — no new coverage surface.

What was run:

  • shellcheck --severity=warning on all tracked *.sh, shfmt -i 4 -d, bash -n, and make lint: clean.
  • Full bash tests/run.sh foreground: pass (~4 min).
  • NOT run: the new leg against a real rig — none available in this environment. It should get its first live execution at the v1.15.2 gate (sudo bash tests/e2e-real.sh watchdog).

🤖 Generated with Claude Code

tests/run.sh has always driven watchdog() through stubs (systemctl,
curl, and _read_temp all faked), so the over-temp stop has never fired
against a real sensor, a real systemd, or a real miner. Add a
'watchdog' phase: it lowers max_temp_c below the live reading (the
same _read_temp the verb itself calls, with a 5°C margin to absorb the
restart's brief dataset-init dip), runs `rigforge.sh watchdog` once,
asserts the stop + hold marker + an independent journal witness, then
restores config, state files, and the running service under the same
snapshot/trap-on-EXIT shape control()/upgrade() already use.

The wedge-restart half (2-strike, unreachable API) is deliberately not
exercised here — forcing that on a production-adjacent rig risks the
same "stranded miner" outcome control()'s own skipped rollback leg
calls out; see #276 for that path against a stubbed apply.

No rigforge.sh changes — the coverage gate is untouched.
…ail on an unresolvable worker root, clamp the cutoff ceiling (#349)
@VijitSingh97
VijitSingh97 merged commit 73efebb into develop Aug 21, 2026
9 checks passed
@VijitSingh97
VijitSingh97 deleted the fix/349-e2e-watchdog-overheat branch August 21, 2026 18:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Watchdog restart-on-overheat has zero live coverage — e2e-real never invokes the verb

1 participant