Skip to content

Preserve diagnostics when wordpress.phpunit crashes in Playground #1916

Description

@chubes4

Problem

The wordpress.phpunit recipe command can exit 1 through PHP.run() while returning HTTP 200 and no stdout, stderr, or response body. WP Codebox then reports only Comlink method call failed, making the workload failure impossible to diagnose or distinguish from a Playground transport/runtime failure.

This reproduced independently across two Automattic/intelligence PRs and multiple reruns:

Representative diagnostic:

Recipe workflow steps[0] failed: wordpress.phpunit crashed before producing a structured response
PHP.run() failed with exit code 1.
httpStatusCode=200
exitCode=1
No Playground stdout, stderr, or response body was captured.
originalErrorClassName=PHPExecutionFailureError
cause=Comlink method call failed

The setup phase succeeds, including Composer autoloader installation, and the failure occurs in run_workloads. The same branches pass their selected PHP smoke tests directly.

Expected

  • Capture PHP fatal/error output, PHPUnit bootstrap errors, and the response body before destroying the runtime.
  • If the worker/Comlink boundary fails before PHP output is available, preserve worker error name, message, stack, request metadata, and runtime logs.
  • Classify workload assertion/bootstrap failure separately from Playground transport/worker failure.
  • Emit a structured failed command response whenever the runtime remains responsive enough to return HTTP 200.

Acceptance criteria

  • A deterministic fixture makes wordpress.phpunit fail during bootstrap and proves stdout/stderr or a structured PHP error is retained.
  • A deterministic fixture crashes the worker/Comlink method and proves worker diagnostics are retained.
  • Homeboy/WP Codebox callers receive actionable raw_output instead of an empty-output wrapper.

AI assistance

  • AI assistance: Yes
  • Tool(s): OpenAI gpt-5.6-sol via OpenCode
  • Used for: Correlated repeated CI failures and drafted the diagnostic-preservation report; Chris reviewed and owns the report.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions