Repository navigation
fix(ci): output-idle runner tests fail when pwsh starts slowly - #2161
Conversation
Test-CiProcess.Tests.ps1 runs in every fast-validation job. Each fixture started a cold pwsh child under a literal 2 s output-idle budget, and the descendant case needed a second cold pwsh to print inside the same window. A cold pwsh took up to 7 s to print anything on a contended host, so the runner reported "produced no output for 2 seconds" or the descendant lifecycle check failed. Use a named, environment-overridable idle budget (OPENCLAW_CI_PROCESS_TEST_IDLE_SECONDS, 10 s) and derive every fixture duration from it, so each case still proves output resets the deadline, silent fixtures fail promptly, and trees are terminated. The descendant signals readiness before going silent, and the test asserts that readiness and whether the root had exited. The prompt bound is measured on the monotonic clock from body entry. Co-authored-by: Copilot App <[email protected]>
|
🦞👀 Pull request received. I will update this pull request when review starts. ClawSweeper review completeClawSweeper finished reviewing this revision. The review result is being finalized. |
|
Codex review: needs maintainer review before merge. What this changesThis PR gives process-runner tests a configurable startup budget and waits for observable descendant readiness before testing silence. Example: A cold PowerShell child needs 7 seconds to produce its first output on a loaded Windows host.
Review scores
ProductKind: Test only · Worth it: Yes · Fix scope: Complete Merge readiness✅ Ready for maintainer review Keep this PR open: it fixes a concrete CI test flake still present on main, preserves the runner's lifecycle coverage, and has no actionable correctness findings. Priority: P2 Before mergeNone. FindingsNone. Agent review detailsHow this fits togetherFast-validation invokes the workflow-contract suite, which launches real PowerShell fixtures through Invoke-CiProcess and checks output, exit status, timeout, and process cleanup. flowchart TD
A[Fast validation] --> B[Workflow contract suite]
B --> C[Process runner tests]
C --> D[Invoke CiProcess]
D --> E[PowerShell fixture and descendant]
E --> F[Output and lifecycle assertions]
Technical reviewBest possible solution: Keep the repair in the existing test script, preserving progress, silence, tree-termination, and inherited-pipe checks. Do we have a high-confidence way to reproduce the issue? Source confirms startup is charged against the two-second idle deadline, and the author reports repeated baseline failures under contention; this read-only review ran no target code. Is this the best way to solve the issue? The smallest complete fix is confined to the existing fixtures: allow measured cold-start headroom, synchronize descendant readiness, and retain independent lifecycle assertions. AGENTS.md: found and applied where relevant. Codex review notes: model internal, reasoning medium; reviewed against 439b7cc9ff3e. Provenance checked
SecurityNone. EvidenceWhat I checked:
Likely related people:
Preflight sourceSource unknown. Source comparison at the observed PR snapshot only. Completion is self-reported; body, policy, tests, execution, and report bytes are not verified. Review metrics
LabelsLabel changes:
Label justifications:
Rating scale6/6 🦀 challenger crab · 5/6 🦞 diamond lobster · 4/6 🐚 platinum hermit · 3/6 🦐 gold shrimp · 2/6 🦪 silver shellfish · 1/6 🧂 unranked krab. Overall follows the weaker of proof and patch quality; ✨ marks media proof (a screenshot, video, or linked artifact) that directly shows the changed behavior. WorkflowClawSweeper edits this one comment on every review. Comment Reviewed November 13, 2026, 4:59 AM ET / 09:59 UTC. |
Related: #2141
What Problem This Solves
Fixes: fast-validation fails intermittently in the CI output-idle runner tests when
pwshstarts slowly on a loaded host.User Impact
User impact: no user-visible change. The always-on fast-validation job no longer needs reruns for this test.
The test now takes about 48 s instead of 16 s in that job. Setting
OPENCLAW_CI_PROCESS_TEST_IDLE_SECONDS=2restores the previous timing.Why This Change Was Made
scripts/Test-CiProcess.Tests.ps1, called fromtest-ci-workflow-contract.ps1, ran every fixture with a literal-IdleTimeoutSeconds 2. Each fixture starts a coldpwshchild, and the runner's idle clock starts at launch. The descendant case also needed a second coldpwshto print within the same 2 s window.A cold
pwshreaches its first output in 0.44–0.48 s on an idle host, but in 3.7–7.2 s when contended. The 2 s budget therefore measured startup, not idleness, and failed with "CI process produced no output for 2 seconds" or "Descendant output lifecycle was not bounded: live-root".Changes (test script and docs only;
Invoke-CiProcess.ps1is unchanged):OPENCLAW_CI_PROCESS_TEST_IDLE_SECONDS(10 s by default). Every fixture duration is derived from it:Evidence
Harness: the script pinned to one CPU with 3 owned busy-loop processes on the same core (stopped by PID afterwards).
maina88888f7)CI process produced no output for 2 seconds.test-ci-workflow-contract.ps1passes (109–112 s).Review:
claude-opus-5.5(high) andgpt-6-astra(long_context, high), plus two delta rounds.Change Type
Scope
winnodeRequired proof pools
none: this changes only a CI-script test and test documentation. The runner itself, product code, UI, MCP, Gateway andsystem.runare unchanged.Validation
The final tree is byte-identical to commit
861ad744(diff SHA256FAFCA465…FBEDagainsta88888f7).pwsh -NoProfile -File scripts/test-ci-workflow-contract.ps1: passed (109 s), including the output-idle process tests.pwsh -NoProfile -File scripts/Test-CiProcess.Tests.ps1:./build.ps1: passed.dotnet test ./tests/OpenClaw.Shared.Tests/OpenClaw.Shared.Tests.csproj --no-restore --no-build: 5849 passed, 29 skipped, 0 failed.dotnet test ./tests/OpenClaw.Tray.Tests/OpenClaw.Tray.Tests.csproj --no-restore --no-build(isolated profile): 6417 passed, 0 failed../scripts/validate-test-timing-patterns.ps1,./scripts/validate-docs.ps1andgit diff --check: passed.Real Behavior Proof
861ad744. The full closeout ran one revision earlier; only the test script's timing source changed after it.CI output-idle process tests passed: exit/output fidelity, progressing fixture, silent fixture termination, tree termination, inherited-pipe deadline., under contention and unloaded.Yes/No/N/A): N/A (script test; output is quoted above).mainhas since moved to439b7cc9; a trial merge is clean.Security Impact
Yes/No): NoYes/No): NoYes/No): NoYes/No): NoYes/No): NoYes, explain the risk and mitigation: N/ACompatibility and Migration
Yes/No): YesYes/No): No. The new optional test-only override is documented indocs/TEST_COVERAGE.md.Yes/No): NoReview Conversations