Skip to content

tools/asahi: show why host tests failed, and name signal deaths - #3849

Merged
DjDeveloperr merged 3 commits into
mainfrom
fix/host-tests-failure-reason
Dec 2, 2026
Merged

DjDeveloperr merged 3 commits into
mainfrom
fix/host-tests-failure-reason

Conversation

@RyanTheTide

Copy link
Copy Markdown
Contributor

What: When host tests fail, the output now shows why. The apple-dcp per-case reasons (out/<case>-failure.log) are printed after the failing-case list and uploaded with the run logs. A test killed by a signal is reported as killed by SIGKILL (likely the out-of-memory killer: an infrastructure failure, re-run it) instead of exit -9. After a failure the job prints free -m and any OOM kills from the kernel log.

Why: ewb asked whether host-tests is flaky. Of the ~200 runs since 12-01 16:00Z, 8 failed. Six were real failures from their own PRs, and they repeated on re-run. Each showed only not ok 70 - physical-disconnect with no reason, because the reason sat in a failure log that was never printed or uploaded. One run (#3845, run 46762152155 attempt 1) had its runner VM shut down mid-job (exit 143). That is fixed on the buildbox side: the runner unit no longer stops on one OOM kill, and ci-overflow re-runs a job once on exit 137/143.

Tested: I checked the helpers against run 46730914700's apple-dcp log: they print the case 70 failure-log tail. died() maps -9, -15, 1 and timeout correctly. I ran this runner in full at #3845's head under MemoryMax=7G with 4 jobs (the buildbox VM's size): 945/945 pass, peak 2.07 GB.

Risk: one-way: CI output only. No test changes pass or fail. Hardware row: n/a (CI tooling only).

A failed host-tests run listed the failing apple-dcp TAP cases but never
their reason. apple-dcp writes each one to out/<case>-failure.log, which
the runner did not print and the workflow did not upload. A test that
was SIGKILLed was reported as a bare "exit -9".

Print the tail of each failing case's failure log (first 10 cases) after
the case list. Report a signal death as "killed by SIGKILL (likely the
out-of-memory killer: an infrastructure failure, re-run it)". Upload the
failure logs with the run logs. After a failure, show free memory and
any OOM kills from the kernel log.

Tested: helper check against run 46730914700's apple-dcp log prints the
case 70 failure-log tail; died(-9)/died(-15)/died(1)/died('timeout')
give the SIGKILL hint/SIGTERM/''/''. Full run of this runner at
linux#3845's head under MemoryMax=7G, 4 jobs: 945/945 pass, peak 2.07 GB.
Risk: one-way: CI output only; no test changes pass/fail.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide
RyanTheTide requested review from a team and DjDeveloperr as code owners December 1, 2026 23:46
@github-actions github-actions Bot added area:gpu Area from CODEOWNERS (bot) area:release Area from CODEOWNERS (bot) door:one-way Revertible or not, from Merge risk (bot) needs-hw-row No hardware row at the PR head (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) labels Dec 1, 2026
@github-actions

github-actions Bot commented Dec 1, 2026 •

Copy link
Copy Markdown

Merge readiness at edff5058: not ready yet

Check Detail
CI at head running running: host-tests
Review ok approved by DjDeveloperr
Requested changes ok none
Hardware row at head no no line with the head SHA edff5058, a Mac and a result in the PR body or a comment
Conflicts ok none
PR text ok Risk: one-way · CI output only. No test changes pass or fail. Hardware row: n/a (CI tooling only).

Areas: area:gpu, area:release

Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels.

@RyanTheTide RyanTheTide left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ran run_all() at base and this head with the same failing TAP case and an unreadable optional physical-disconnect-failure.log. Base returns the failing case and prints the main log tail. This head raises PermissionError inside case_reasons() before the tail or any subsequent diagnostics are printed. In the default temporary-work mode, that also leaves main() with an empty failed list and it cleans up the logs. Treat reading optional per-case reasons as best-effort and keep the normal failure report on OSError.

An unreadable <case>-failure.log raised PermissionError in case_reasons()
before the run's normal failure report, and in temporary-work mode main()
then cleaned up the logs with an empty failed list. Skip any reason file
that cannot be read (OSError), so the report never depends on it.

Tested: case_reasons() on run 46730914700's apple-dcp log with case 70
readable, case 71 a directory, case 73 mode 000, case 92 missing: prints
only case 70's reason, no exception.
Risk: one-way: CI output only.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Fixed in e6004cc (one commit on top, no force push). case_reasons() now skips any reason file it cannot read (OSError: unreadable, a directory, or missing), so the normal failure report and the kept logs no longer depend on it. Checked on run 46730914700's apple-dcp log with case 70 readable, 71 a directory, 73 mode 000 and 92 missing: only case 70's reason prints, and nothing raises.

@RyanTheTide RyanTheTide left a comment

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The unreadable regular file now preserves the primary failure tail. The retry drops the regular-file check, though. With an existing --work directory whose out/physical-disconnect-failure.log is a FIFO with no writer, the exact case_reasons call blocks opening it and the suite never prints its primary failure tail. The prior head skipped that path. Keep the is_file() check inside the OSError guard so an optional diagnostic cannot block on a nonregular file.

Reading a reason path that is a FIFO in a reused work directory blocked
the report forever. Read a <case>-failure.log only when lstat() says it
is a regular file; a FIFO, directory, symlink or missing file is skipped.

Tested: case_reasons() on run 46730914700's apple-dcp log with case 70
readable, 71 a directory, 73 mode 000, 92 a FIFO: prints case 70's
reason only and returns at once (under a 10 s timeout).
Risk: one-way: CI output only.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Fixed the FIFO stall in edff505: a reason file is read only when lstat() reports a regular file. FIFOs, directories, symlinks and missing files are skipped, and OSError is still caught. Checked with case 70 readable, 71 a directory, 73 mode 000 and 92 a FIFO: only case 70's reason prints, and the call returns at once.

@DjDeveloperr DjDeveloperr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the full diff at edff505. Verified that a regular case reason prints and that missing or unreadable files, directories, symlinks, and a FIFO leave the normal failure report intact. Checked signal and timeout reporting. This only changes CI diagnostics and artifact capture. No runtime change.

@github-actions github-actions Bot removed the needs-review No approving review from Core or Omarchy Mac yet (bot) label Dec 2, 2026
@DjDeveloperr
DjDeveloperr merged commit 5d2000f into main Dec 2, 2026
5 checks passed
@DjDeveloperr
DjDeveloperr deleted the fix/host-tests-failure-reason branch December 2, 2026 00:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:gpu Area from CODEOWNERS (bot) area:release Area from CODEOWNERS (bot) door:one-way Revertible or not, from Merge risk (bot) needs-hw-row No hardware row at the PR head (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants