Skip to content

Unit CI reports test nodes and stalled thread stacks - #896

Closed
zlareb1 wants to merge 1 commit into
mainfrom
ci/unit-failure-diagnostics
Closed

zlareb1 wants to merge 1 commit into
mainfrom
ci/unit-failure-diagnostics

Conversation

@zlareb1

@zlareb1 zlareb1 commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

Related: #883

Changelog category (leave one):

  • CI Fix or Improvement (changelog entry is not required)

Changelog entry (one or two sentences a user of Loom can read without the diff; the release pull request collects these into the release notes):

Not required.

Why

A stalled unit shard can reach its job deadline before pytest writes a failure summary or JUnit artifact. Dot-only output does not identify its failed tests or the test still running.

Verbose pytest output records each node and its verdict while the run proceeds. The built-in faulthandler prints Python thread stacks when a test's setup, call and teardown together exceed five minutes. It prints no local values and does not stop the test. Failure tracebacks still appear in the final summary; an async stack dump can show event-loop frames and need a follow-up focused on the named node.

Scope and risk

Only the unit command's reporting flags change. All six shards retain their workload, worker count, random seed calculation, coverage collection, JUnit path, assertions and original 30-minute job deadline. No early-exit or retry flag is added.

Verbose output adds a line per node verdict and scheduler output, increasing log size and report I/O. It does not change test CPU measurement code, measurement windows or thresholds. Pytest still measures each test before reporting its verdict; the extra output and watchdog can add runner overhead, so this makes no performance claim.

Compatibility, rollout and rollback

  • Wire: none.
  • Operator steps: none.
  • Rollback: revert the reporting flags; no stored data or generated files change.

Tests

  • Parsed the workflow as YAML and checked the exact diff contains only the verbosity replacement and faulthandler option.
  • Checked the unit matrix remains parts 1 through 6, fail-fast remains false, the job deadline remains 30 minutes, and seed, coverage, JUnit and shard environment are unchanged.
  • git diff --check passes.
  • No local tests or product runtime were started. All 42 CI checks, all three workflows and all 41 underlying jobs pass. The related run also records named failures and a nonterminating thread-stack dump; that cancelled run remains incomplete.

AI assistance in the code (leave one; writing this description with AI is fine):

  • AI-generated: An agent wrote the change and checked the reporting flags against the pinned pytest and worker implementations.

  • I can explain every line of this diff and how it interacts with the rest of Loom.

Checklist

  • CI gates pass; no broad local suites were run.
  • Generated files: not applicable.
  • Migrations: not applicable.
  • Plugin files: not applicable.
  • Frontend: not applicable.
  • Documentation, operator steps and wire changes: not applicable.
  • Repository text contains no private names or paths.
  • Commits are signed off (git commit -s).

A shard can reach its job deadline before pytest prints a failure summary.
Record node verdicts as they arrive and dump thread stacks after five minutes
inside a test without terminating it.

Signed-off-by: zlareb1 <[email protected]>
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.

1 participant