Skip to content

CI: the process snapshot step can hang for 35 minutes and has no step timeout #42

Closed

Description

@Blind-Striker

The CI step "Record processes after tests" hung for about 35 minutes on windows-2025, after the tests had passed.

Run: https://github.com/opencode-dotnet/opencode-mcp/actions/runs/43763141497, attempt 1, job "Build and test (windows-2025)".

  • Tests finished at 21:24:13Z. "Upload test results" then failed at once.
  • "Record processes after tests" started at 21:24:13Z and was still running at 21:59Z, when the run was cancelled.
  • A re-run of the same job passed.

What the step runs

  • .github/workflows/ci.yml:242-247 runs dotnet run --no-build tools/native.cs -- snapshot --output ... with if: always() and no timeout-minutes. native.yml has the same step four times (lines 122, 225, 332, 459), also unbounded. Only the job bound applies (55 minutes in CI).
  • tools/OpenCode.Mcp.Tools/Native/NativeProcessSnapshot.cs:10 starts pwsh -Command "Get-Process | Select-Object Id,ProcessName,CPU,WorkingSet64,StartTime,CommandLine | ConvertTo-Json".
  • tools/OpenCode.Mcp.Tools/Native/NativeProcesses.cs:11 gives that child process a 35-minute timeout, the default for anything that is not dotnet test. That matches the 35 minutes observed.

Likely cause

On Windows, PowerShell's CommandLine property is read through a WMI process query, one per process. That query can block for a long time while a process is exiting or a provider is busy, which fits a snapshot taken right after the test processes ended. This is not confirmed: the job log for the hung attempt was not kept after the cancel.

Effect

A diagnostics-only step can hold a CI or Native leg for 35 minutes, and can push it to the job timeout. That fails CI result even though every test passed.

Fix when

Soon. It holds the required check.

Options, likely together:

  • timeout-minutes on each "Record processes after tests" step (for example 5).
  • A short timeout for the snapshot's child process, instead of the 35-minute default.
  • A command-line source that cannot block, or that the snapshot can skip on time-out, so the snapshot still records the other fields.
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions