Skip to content

test(main): stop gitSecurity fixtures flaking on Windows runners - #256

Merged
johnny4young merged 1 commit into
mainfrom
fix/git-security-test-windows-flake
Oct 15, 2026
Merged

johnny4young merged 1 commit into
mainfrom
fix/git-security-test-windows-flake

Conversation

@johnny4young

Copy link
Copy Markdown
Owner

Summary

Windows platform hardening failed once on #255 in tests/main/gitSecurity.test.ts and passed on rerun:

  • git commit -m fixture in beforeEach hit the helper's 5 s execFileSync timeout (spawnSync git ETIMEDOUT);
  • the killed, half-initialised repository then failed rmSync with EPERM in afterEach.

A cold git on a hosted Windows runner (new temp dir, antivirus scanning) can exceed 5 s per call. The change:

  • fixture git calls are bounded at 30 s;
  • this file's hooks and tests get 60 s (vi.setConfig), because beforeEach alone makes five git calls and Vitest's default hook timeout is 10 s;
  • every temporary-directory removal retries (maxRetries: 5, retryDelay: 200), the same pattern dependencies.install.windows.test.ts uses.

Production code is unchanged.

Validation

  • tests/main/gitSecurity.test.ts: 9 passed locally; typecheck:tests and lint clean.
  • The Windows platform hardening job on this PR runs the file on the runner where it flaked.

- Each fixture git call was killed after 5 s; a cold git on a hosted Windows runner exceeded that during the fixture commit, and the half-finished repository then failed cleanup with EPERM.
- Bound git calls at 30 s, give this file's hooks and tests 60 s for their several git calls, and retry temporary-directory removal as the Windows install test already does.

Changelog: none
@johnny4young
johnny4young merged commit 442995f into main Oct 15, 2026
13 checks passed
@johnny4young
johnny4young deleted the fix/git-security-test-windows-flake branch October 15, 2026 16:15
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.

1 participant