hil: harness follow-ups from #4594 (park refusal race, interrupted notice, runner stop)
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 22/100
Research direction
Start in test/hil/hil_test.py at _should_park/_park_refusal and their callers _sysview_capture/_board_battery, then _abort_report/_already_aborted in helper/hil_report.py, _BoardProcess.ended/_stop_boards, _died_row, and _retain in helper/farm_profile.py; line numbers are offset by a few dozen. Reproduce each with the in-process stubs the report describes before editing, and note item 5 asks for an interrupt-policy decision rather than a patch. Done means one refusal string drives both decision and message, termination is matched from the recorded signal, lingering-but-finished rows survive, and test_hil_flash.OpenocdEsp stops leaving /tmp/tinyusb-hil-locks fixtures behind.
Written by the indexing model from the issue text.
Description
These come from the audit record refresh for #4542, which reviewed #4594 (490eb4ec9..17301f1a6). Claude and Codex each checked the other's findings, and each item below was reproduced in-process with stubs. Nothing was run on a rig. The audit's own harness commits do not touch any of these paths. Line numbers are at 17301f1a6 plus the audit commits, so they are a few dozen lines off in hil_test.py.
Defects
- SystemView capture can skip the park checks (
test/hil/hil_test.py_should_park/_park_refusal, used in_sysview_captureand_board_battery):- The two functions re-read the openocd_esp pending record separately.
pending_refusal()clears entries that have ended. So when an older run's record clears between the two calls, the reason comes back empty. The park then reportsnot parked:with no cause.- In
_sysview_capture, that empty reason falls past theelif/elsethat holds the park-image and remaining-time checks, so the capture runs without them. - Fix: compute one refusal string (
''means park) and use it for both the decision and the message.
- An interrupted run's notice gets overwritten (
hil_test.py_abort_reportwithhelper/hil_report.py_already_aborted):- The banner reads
**HIL run interrupted by SIGTERM.**, but_already_aborted()matches only the**HIL run abprefix. - So an accumulating no-boards re-run replaces both the caveat and the termination with
no-boards. - Fix: match on the recorded termination instead of the caveat text.
- The banner reads
- A finished row is lost when its process outlives the stop grace (
hil_test.py_BoardProcess.ended/_stop_boards):b.resultis filled at pipe EOF, but a board only counts as ended once its sentinel fires.- A board that has written its row and then lingers (an atexit handler or a non-daemon thread) goes to
_left_running. Its row is dropped and_abort_reportlists it as never reported. - Fix: keep the row, and also report that the process survived.
- A real-time signal aborts the whole run (
hil_test.py_died_row):signal.Signals(-exitcode)raisesValueErrorfor SIGRTMIN+n, which escapesrun_boards. Fix: fall back tosignal {n}. - A second SIGINT can skip stopping the boards (
hil_test.pyrun_boardsfinally):- The window is short: before
_stop_boards()'s_interrupts_ignored()takes effect. - In that window, a second SIGINT escapes without stopping the boards or registering survivors.
- Moving the context manager alone does not close every entry window, so the parent's interrupt policy needs a decision.
- The window is short: before
- An agentrc identity error can hide the reset's own failure (
helper/farm_profile.py_retain):_retainruns inreset'sfinally, and its_engine()reload can raise when agentrc's source identity changes mid-reset.- That error replaces the reset's own exception and loses its
.operation. - Fix: keep both failures, without suppressing the identity error.
- Minor:
_frame_resultturns an unpickle failure into a generic "died (exit code 0)" row; put the decode error in the cell..github/workflows/pr_comment.yml:311-315still says the code-size comment reports a failed agentrc fetch, but a missing agentrc now fails the freshness check and posts nothing, which is intended. Drop the stale comment and the redundantcontinue-on-error.
Cleanups
- An explicit agentrc engine API for unresolved evidence (
ctx.retain_unprovenor similar), sofarm_profile._retainstops appending rows to the engine-privatectx.ledger. This needs an agentrc change. .claude/skills/hil-contract/SKILL.md:215: keep tinyusb's obligations (which entry points refuse, when to stop the board, what the cell shows) and link agentrc'shilFlashers and Recovery sections for the pending record's mechanics.
Test isolation (pre-existing)
test_hil_flash.OpenocdEsp writes a fake pending record (usj-30_ED_A0_E0_C9_02.openocd-esp-pending.json, token t0k) into the real /tmp/tinyusb-hil-locks, so the next hil-test run fails two OpenocdEsp tests. This was observed on master 490eb4ec9: a clean run leaves the file behind, and the next run fails.
- Dominant language
- C
- Stars
- 7.3k
- Forks
- 1.6k
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 67
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from hathach/tinyusb
-
follow-up Port WCH USBFS Prio 📌
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
Maintainers usually reply within 1 day
-
follow-up Prio 📌
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
hil-contract: a background hil_remote.py launch is killed at the Bash default 10 min timeoutPossibly taken @hathach claimed this 16 days ago. Openfollow-up Prio 📌
Difficulty 1/5 Under an hour Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
ch32v30x: debug UART loses queued bytes when its TX ring fillsPossibly taken @hathach claimed this 16 days ago. Openfollow-up Prio 📌
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Maintainers usually reply within 1 day
-
followup Prio 📌
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 69/100
-
Missing slice offset check in jvp_equal fast path corrupts slice comparison and aborts delpathsOpen
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 3 days
-
Difficulty 1/5 Under an hour Newbie friendliness 83/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
area9innovation/flow9#1805 ·
Maintainers usually reply within 3 days
-
AI:Robustness triage
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
open5gs/open5gs#5246 · 1 comment ·
Maintainers usually reply within 1 day