Skip to content

test(windows): warm the PowerShell ancestry probe before its timed run - #7885

Merged
lidge-jun merged 1 commit into
devfrom
p1/7854-powershell-probe-warmup
Oct 29, 2026
Merged

lidge-jun merged 1 commit into
devfrom
p1/7854-powershell-probe-warmup

Conversation

@lidge-jun

@lidge-jun lidge-jun commented Oct 28, 2026 •

Copy link
Copy Markdown
Owner

Summary

tests/clients/desktop-compatibility-build-probe.test.ts ("owned ancestor junctions and persistent retargets fail before proof publication") bounded its PowerShell child at 10 s and failed on a hosted Windows shard: the child was killed at the deadline with empty stdout and stderr, while the same test passes in about 1.5 s on other runs.

Measured on a busy Windows host, the script body finished in under 0.7 s even with 24 copies running at once. The PowerShell process around it took 2-8 s to start and exit, and PowerShell only flushes its output at exit, so a deadline kill always looked silent. The 10 s bound was measuring PowerShell process lifecycle under load, not the guard.

This replays the same probe once in a beforeAll through warmColdSpawn, as the sibling desktop-compatibility-trust and desktop-compatibility-launch tests already do, and keeps the measured 10 s bound unchanged. The script now also writes phase markers to stderr; they survive a deadline kill and name the last completed step. No timeout was raised and no retry was added.

Closes #7854

Verification

  • Pinned Bun 1.4.4.
  • Timing probe (scratch, not committed): the same script with per-phase timestamps, run 1 and 24 times concurrently. Every phase finished within ~0.7 s of spawn; total process time was 7.8-8.8 s on this loaded host. A trivial powershell -NoProfile -Command "'ok'" took 0.4-1.9 s unloaded and 4.7 s under load.
  • bun test tests/clients/desktop-compatibility-build-probe.test.ts: 12 pass / 0 fail. Warm-up mode=replay elapsedMs=526, measured run 478 ms.
  • bun test tests/ci-workflows/cold-spawn-warmup.test.ts tests/ci-workflows/warmup-registration.test.ts tests/test-layout.test.ts tests/clients/desktop-compatibility-build-probe.test.ts: 57 pass / 0 fail.
  • bun run typecheck: no type errors in 2,227 files. git diff --check origin/dev...HEAD: clean.
  • A load-dependent timeout has no deterministic red run. The evidence is the phase measurement above. The Windows shard is left to the next batched dev dispatch; no lane=all was started for this PR.

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed. (Test-only.)
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults. (No product code changed.)

Summary by CodeRabbit

  • Tests
    • Updated Windows compatibility checks to run the path-validation scenarios after a warm-up, while preserving the existing test time limits. No end-user behavior changes are included.

#7854)

The ancestry guard test bounded its PowerShell child at 10s and failed on a
hosted Windows shard with empty stdout/stderr (killed at the deadline). On a
busy Windows host the script body finished in under 0.7s even with 24 copies
running at once, while the PowerShell process around it took 2-8s to start
and exit, so the bound was measuring process lifecycle, not the guard.

Replay the same probe once in a beforeAll through warmColdSpawn, as the
sibling desktop-compatibility trust and launch tests already do, and keep the
measured 10s bound unchanged. The script now writes phase markers to stderr,
which survive a deadline kill and name the last completed step; PowerShell
only flushes the JSON verdict at exit.

Closes #7854
@coderabbitai

coderabbitai Bot commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
Commits

Reviewing files that changed from the base of the PR and between fdc6dd8 and f5b9a2e.

Files selected for processing: 1
  • tests/clients/desktop-compatibility-build-probe.test.ts

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 4 remain after this review.

Walkthrough

The Windows-only test now warms the owned-ancestor PowerShell probe before its measured run. The extracted helper accepts a caller-provided deadline and writes phase markers. The test keeps its 10-second child deadline and 20-second timeout.

Changes: Windows ancestry probe

Layer / File(s) Summary
Extract and warm the PowerShell probe
tests/clients/desktop-compatibility-build-probe.test.ts
The test scenarios move into probeOwnedAncestry(deadlineMs), which retains the junction-retargeting and publication-revalidation checks and adds stderr phase markers. A Windows-only suite warms the probe in beforeAll and then runs it with the existing 10-second child deadline. The test timeout remains 20 seconds.

Priority: Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Other · Severity of issue fixed: Low

Possibly related PRs

  • lidge-jun/opencodex#7598: Warms a Windows PowerShell certificate-store inspection before its timed test while keeping the deadline.
  • lidge-jun/opencodex#7501: Warms a Windows-only desktop compatibility test before timed validation while preserving the timeout.

Suggested labels: ci:full

Suggested reviewers: ingwannu

Merge Risk: Minimal · up to f5b9a

The probe is warmed before the existing timed test. No merge-blocking risk was established; Windows shard timing remains unverified.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly describes the main change: warming the Windows PowerShell ancestry probe before its timed test run.
Linked Issues check Passed Issue #7854 reports an intermittent 10-second timeout in the Windows PowerShell ancestry probe. In tests/clients/desktop-compatibility-build-probe.test.ts (probeOwnedAncestry and the Windows package…
Out of Scope Changes check Passed The changes stay within issue #7854. The refactor extracts the affected probe so warm-up and measured runs execute the same fixture and assertions. The stderr markers and warm-up setup both support di…
Docstring Coverage Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentat…
Full details: Linked Issues check

Explanation

Issue #7854 reports an intermittent 10-second timeout in the Windows PowerShell ancestry probe. In tests/clients/desktop-compatibility-build-probe.test.ts (probeOwnedAncestry and the Windows package ancestry suite), beforeAll replays that same probe through warmColdSpawn before the measured run. The measured call keeps its 10,000 ms child deadline. The probe also writes stderr phase markers after key steps, which improves diagnosis if a child is killed. The change addresses the reported cold-start cost without adding a retry or extending the measured deadline. The PR summary reports 12 passing tests for this file and 57 passing tests in the related suite.

Full details: Out of Scope Changes check

Explanation

The changes stay within issue #7854. The refactor extracts the affected probe so warm-up and measured runs execute the same fixture and assertions. The stderr markers and warm-up setup both support diagnosing or reducing the reported timeout. No unrelated product code or unrelated test behavior changed.

Full details: Docstring Coverage

Explanation

Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff with cyclomatic complexity of at least 2. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 1 files.

Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

@github-actions github-actions Bot added the chore Maintenance, CI, tests, refactors, or build changes (not a user-facing bug or feature). label Oct 28, 2026
@lidge-jun
lidge-jun marked this pull request as ready for review October 28, 2026 09:29
@lidge-jun
lidge-jun requested a review from Ingwannu as a code owner October 28, 2026 09:29
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-28T09:30:58.654571Z f5b9a2e Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@lidge-jun
lidge-jun merged commit d588ca9 into dev Oct 29, 2026
32 checks passed
@lidge-jun
lidge-jun deleted the p1/7854-powershell-probe-warmup branch October 29, 2026 04:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Maintenance, CI, tests, refactors, or build changes (not a user-facing bug or feature).

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant