Skip to content

porch done truncates failing check output; the failing test is never named #1853

Done

Description

@amrmelsayed

Problem

porch done runs the project's test check before advancing a phase. When the check fails, porch prints a truncated tail of the output, so the failing test is never named. An intermittent failure at that step therefore cannot be investigated after the fact: a retry clears it and the evidence is gone.

Measured case

Spec 1595 builder, phases 7 and 8, 2026-10-21:

  • the test check failed three times at porch done, and passed on immediate retry each time
  • every failing run started within seconds of a git commit
  • the same suite never failed when run directly, nor in porch-shaped replays
  • the truncated output did not include the failing test name in any of the three runs

The builder's thread log on the 1595 branch (codev/state/spir-1595_thread.md, lands on main with the PR) carries the timestamps.

Ask

  1. Persist the full check stdout and stderr per run under the project directory, for example codev/projects/<id>/checks/<phase>-<timestamp>.log, and name that file in the truncated terminal message.
  2. Keep the truncated terminal output as is; the file is the record.
  3. With the record in place, investigate the commit-adjacent timing (the three failures all followed a commit by seconds, which points at a race with porch's own chore commit or a build step rather than at the tests).

An intermittent failure at a fixed step is a step-level signal, not noise. Today it goes unreported because the retry passes and nothing names the test.

Activity

  1. added
    area/porch
    on Oct 21, 2026
  2. waleedkadous commented on Nov 24, 2026

    @waleedkadous
    Contributor

    Scope for the fix (BUGFIX), from the 2026-11-23/24 cases where four different builders could not name a failing test:

    1. Persist the full output of every failed check (stdout and stderr) to a file under the project directory, as the issue asks, and print that path in the terminal message. Keep it out of git (the directory should be ignored like the other per-run review outputs) and keep only a bounded number of files per project.
    2. Show the useful end, not the useless start. Today formatCheckResults (packages/codev/src/commands/porch/checks.ts) prints the first five lines of the error, which for the tests check are npm and tool warnings. Print the last lines instead (enough to include a test runner's failure summary), plus the path to the full file.
    3. Out of scope: the issue's third ask (the commit-adjacent timing). The intermittent failures are now explained by issue tests: one run of the packages/codev unit suite takes an 18-core Mac from load 8 to 59, and its own spawn-heavy tests then time out #1956 (the unit suite runs one test file per core since the Vitest 4 upgrade; the single-fork setting is a no-op). Do not investigate it here.
    4. Tests: a failing check whose output starts with 50 lines of warnings and ends with a failure summary shows the summary and the file path; the file holds the complete output; a passing check writes nothing.

    porch.checks overrides and the timeout path (a check killed at its limit) must also write the file: a timed-out check is the case where the output matters most.

  3. waleedkadous commented on Nov 24, 2026

    @waleedkadous
    Contributor

    On it! Working on a fix now.

  4. added 8 commits that reference this issue on Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/porch

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions