Skip to content

test(electron): CI-sized budget for the real-junction identity probe - #12819

Merged
iamwhatever merged 1 commit into
mainfrom
fix/electron-junction-test-budget-12685
Sep 22, 2026
Merged

iamwhatever merged 1 commit into
mainfrom
fix/electron-junction-test-budget-12685

Conversation

@CrysisDeu

Copy link
Copy Markdown
Contributor

What

Test-only change to website/electron/test/windows-port-real-junction.test.js:

  • warm the CIM provider once before spawning the child (windowsProcessCommand(process.pid, …) with a generous budget), so the hosted runner's WMI cold start is paid outside the asserted probe;
  • pass an explicit CI-sized budget to the asserted probe (powershellTimeoutMs: 30000, wmicTimeoutMs: 15000) instead of the production defaults;
  • reword the first assertion so an empty result reads as "identity probe returned nothing within N ms (PowerShell timed out or failed and WMIC was unavailable)" rather than implying a spelling mismatch.

No production code changes.

Why

Electron Shell Tests (Windows port identity) failed twice on unrelated PRs (#11827, #12672) with actual: '' after ~9-10 s. The test called windowsProcessCommand(child.pid) with the launcher's production defaults: PowerShell Get-CimInstance Win32_Process bounded at 8 s, then a WMIC fallback bounded at 5 s. On a cold windows-latest runner the first CIM query can exceed 8 s; wmic.exe is not installed on that image, so the fallback fails at once and the function returns "" by design (fail-closed: unknown process = foreign). The test read that "" as "the OS did not identify the process".

The 8 s / 5 s defaults are the launcher's stop-path budget and are what the fake-CIM tests in windows-port.test.js prove. This test proves the junction spelling contract, which needs the probe to answer, so it should not inherit a budget sized for a different purpose.

How

  • CI_PROBE_BUDGET (30 s / 15 s) is passed to the asserted probe; CIM_WARMUP_BUDGET (60 s / 15 s) is used for the one-off warm-up against process.pid. Both stay well inside the job's timeout-minutes: 10.
  • The warm-up result is intentionally not asserted: its only job is to pay the CIM cold start.
  • Enumeration of every Electron test that calls windowsProcessCommand:
    • test/windows-port-real-junction.test.js:91 — real OS, production defaults → affected, fixed here.
    • test/windows-port.test.js:148, 173, 195, 209 — fake execFileFn, no real process or timer → not affected.
    • test/windows-port.test.js:475 — rejects on pid validation before any exec → not affected.
    • test/windows-port-junction.test.js — does not call windowsProcessCommand.

Tests

  • This is a Windows-only test; it cannot run on the Linux host that authored this PR. node --test test/windows-port-real-junction.test.js on Linux: 2 skipped, 0 failed (skip reason as before).
  • node --check and eslint on the changed file: clean.
  • The only real verification is CI's electron-test-windows job on this PR. The change is conservative (larger budgets and a warm-up only; the spelling and matcher assertions are unchanged), so a green run proves the test still exercises the contract, and a red run would now name the timeout explicitly.

Pattern harvest

  • Rule candidate: a real-OS integration test must not inherit a helper's production timeout defaults when those defaults encode a different purpose (here: "give up fast on the stop path"). Pass the budget the test actually needs and say why in a comment.
  • Not generalizable: the concrete 30 s / 15 s / 60 s numbers are sized for hosted Windows runners and this one probe.

Other

Closes #12685

The Windows-only junction test asked windowsProcessCommand for a child's
identity with the launcher's production defaults (PowerShell 8 s, WMIC
5 s). On a cold hosted Windows runner the first Get-CimInstance call can
exceed 8 s, wmic.exe is absent on current runner images, and the
function returns "" by design, which the test misread as "not
identified". Warm the CIM provider once against our own pid, give the
asserted probe an explicit 30 s / 15 s budget, and make the first
assertion say what an empty result means.

Closes #12685
@CrysisDeu
CrysisDeu requested review from a team and cixuuz September 22, 2026 13:42
@github-actions github-actions Bot added the readiness: checking Automated validation is still running label Sep 22, 2026
@github-actions

Copy link
Copy Markdown
Contributor

GPT 5.6 Review — ✅ no blocking findings

GPT 5.6 completed its review of 29dee190d688b004a813ce6200b2dd6b335e3678 and found no blocking issues.

This comment is updated in place on each push.

Review details

No findings.
[GPT-REVIEWED] 29dee19

False positive or not applicable? A repository writer can comment:
/ai-review override gpt 29dee190d688b004a813ce6200b2dd6b335e3678: <one-sentence reason>

@github-actions

Copy link
Copy Markdown
Contributor

Opus 4.8 Review — ✅ no blocking findings

Reviewed 29dee190d688b004a813ce6200b2dd6b335e3678 — this comment is updated in place on each push.

Review details

No findings.

[OPUS-REVIEWED] 29dee19

Verdict parsed from the review's SHA-scoped output markers for commit 29dee190d688b004a813ce6200b2dd6b335e3678.

False positive or not applicable? A repository writer can comment:
/ai-review override fable 29dee190d688b004a813ce6200b2dd6b335e3678: <one-sentence reason>

@github-actions

Copy link
Copy Markdown
Contributor

UX Review (Fable 5) — ✅ PASS

UX-level review of 29dee190d688b004a813ce6200b2dd6b335e3678 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

UX-Verdict: PASS

Nothing to check.

[UX-REVIEWED] 29dee19

@github-actions

Copy link
Copy Markdown
Contributor

Design Review (Fable 5) — ✅ PASS

Design-level review of 29dee190d688b004a813ce6200b2dd6b335e3678 — updated in place on each push. A BLOCK verdict blocks PR readiness; PASS/CONCERNS are advisory.

Design-Verdict: PASS

Confirm electron-test-windows is green on this PR — it is the only run that exercises the changed test.

[DESIGN-REVIEWED] 29dee19

@github-actions github-actions Bot added readiness: action required A blocking check or review needs attention readiness: checking Automated validation is still running readiness: passed Eligible automated validation passed for the current revision and removed readiness: checking Automated validation is still running readiness: action required A blocking check or review needs attention labels Sep 22, 2026
@iamwhatever
iamwhatever enabled auto-merge (squash) September 22, 2026 17:22
@iamwhatever
iamwhatever merged commit cb82646 into main Sep 22, 2026
98 of 99 checks passed
@iamwhatever
iamwhatever deleted the fix/electron-junction-test-budget-12685 branch September 22, 2026 17:22
@github-actions github-actions Bot removed the readiness: passed Eligible automated validation passed for the current revision label Sep 22, 2026
wknight1 pushed a commit to wknight1/KiroCrew that referenced this pull request Oct 5, 2026
…et (kirodotdev#12819)

The Windows-only junction test asked windowsProcessCommand for a child's
identity with the launcher's production defaults (PowerShell 8 s, WMIC
5 s). On a cold hosted Windows runner the first Get-CimInstance call can
exceed 8 s, wmic.exe is absent on current runner images, and the
function returns "" by design, which the test misread as "not
identified". Warm the CIM provider once against our own pid, give the
asserted probe an explicit 30 s / 15 s budget, and make the first
assertion say what an empty result means.

Closes kirodotdev#12685
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ci(windows): Electron port-identity test "a process launched through a junction is matched however Win32_Process spells it" times out at 10s

2 participants