Skip to content

Slow Windows CI runs no longer fail main: tests and hooks get 30 seconds on Windows - #411

Merged
wmadden-electric merged 2 commits into
mainfrom
fix/skills-sync-windows-timeout
Nov 27, 2026
Merged

wmadden-electric merged 2 commits into
mainfrom
fix/skills-sync-windows-timeout

Conversation

@wmadden-electric

Copy link
Copy Markdown
Contributor

Tests on the Windows CI job fail now and then because the whole machine runs several times slower for a while, not because any code is wrong. This change gives each test, and each setup and cleanup hook, 30 seconds on Windows, so a slow run no longer fails main. In packages/cli/vitest.config.ts:

const WINDOWS = process.platform === "win32";
// ...
testTimeout: WINDOWS ? 30_000 : 5_000,
hookTimeout: WINDOWS ? 30_000 : 10_000,

The values for other platforms, 5 and 10 seconds, are vitest's defaults, so nothing changes on macOS or Linux. The cost: a test that truly hangs on Windows takes up to 30 seconds to fail, not 5.

The failures

The Test workflow runs packages/cli's tests on Ubuntu and Windows. Over the last 40 failed runs, every Windows failure of this kind was "Test timed out in 5000ms", in a different test each time:

Date Test file Run
2026-09-11 tests/init.test.ts
2026-09-29 tests/credential-manager.test.ts 36538757391
2026-10-07 tests/spawn-adapter.test.ts 37613792323
2026-11-26 tests/skills-sync.test.ts 45799058095

In the 2026-11-26 run, the test "installs a skill into every harness directory from an npm layout" ran for 5,035 ms and was stopped. On a Mac it takes 15 ms. In the same run everything else slowed down too. Compared with the re-run of the same commit, which passed:

  • the total test time rose from 45 to 79 seconds;
  • tests/credential-manager.test.ts went from 3.4 to 16.2 seconds;
  • vitest's own code transform step went from 3.6 to 7.7 seconds.

So the slowdown hits the whole machine, and whichever test is running when it is worst goes over the limit.

Why 30 seconds, and why hooks too

The most extra time any one test file took in the slow run was about 13 seconds, spread over many tests. 30 seconds is well clear of that and still short enough that a real hang fails the job.

Each test's temporary project folder is deleted in a cleanup hook, and vitest gives hooks their own limit of 10 seconds. The same slowdown could fail a run there, so hooks get 30 seconds as well. That cleanup is also where the second error in the 2026-11-26 log came from (ENOTEMPTY while removing the folder). It happened because vitest started the cleanup while the stopped test was still writing. Once the test is no longer stopped early, that error goes away too.

The limits apply on any Windows machine, a developer's included, not only in CI. They only raise a limit, so nothing that passes today starts failing.

How it was checked

  • tests/skills-sync.test.ts passes locally with the new config.
  • No test sets its own timeout in a way that undoes this. The one lower value, 20 seconds in tests/auth.test.ts, is for a test that waits on a fixed 3-second timer.
  • The Windows job runs pnpm --filter @prisma/cli test, which loads this config. This pull request's own Windows run is the first run with it.

Alternatives considered

  • Re-run the job when it happens. That is how main was fixed on 2026-11-26. But each failure still costs someone time to look into.
  • Retry failed tests on Windows (vitest's retry). It would hide real failures that happen only some of the time, not just slow runs.
  • A longer limit only on the tests that failed. A different test failed each time, so the next slow run would fail another one.
  • A longer limit only when CI is set. A developer's Windows machine can slow down in the same way, and a higher limit costs nothing while tests are fast.
  • Fewer parallel test workers on Windows. This might reduce how often the machine slows down, but the logs do not show that contention between workers is the cause, and it would make every Windows run slower.

Agent: orpheus-67

GitHub's Windows runners sometimes stall on filesystem work. In those runs a test that normally takes milliseconds goes past vitest's 5-second default and fails main. It happened on 2026-09-29, 2026-10-07 and 2026-11-26, each time in a different test.

Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>
Fixture cleanup runs in hooks under vitest's 10-second hook default, so the same slowdown could fail a run there.

Signed-off-by: willbot <w.a.madden+machine@gmail.com>
Signed-off-by: Will Madden <madden@prisma.io>
@coderabbitai

coderabbitai Bot commented Nov 27, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Summary by CodeRabbit

  • Tests
    • Windows test runs now allow more time for tests and hooks to complete. Time limits on other platforms remain unchanged. This change affects test execution only; it does not alter app features or behavior.

Walkthrough

The Vitest configuration detects Windows. It sets test and hook timeouts to 30 seconds on Windows, and to 5 and 10 seconds, respectively, on other platforms.

Merge Risk: Minimal · up to 14144

This change gives slow Windows CI runs more time before tests or hooks time out. Other platforms are unaffected. A genuinely hung Windows test now fails after up to 30 seconds. No merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: Windows test and hook timeouts are raised to 30 seconds in packages/cli/vitest.config.ts so slow Windows CI runs stop failing main. The config diff adds Windows-specif…
Description check Passed The description explains the intermittent Windows CI timeouts, the new 30-second limits for tests and hooks on Windows, and the unchanged 5/10-second limits elsewhere. It also lists alternatives and v…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: Windows test and hook timeouts are raised to 30 seconds in packages/cli/vitest.config.ts so slow Windows CI runs stop failing main. The config diff adds Windows-specific testTimeout and hookTimeout values, which matches the title.

Full details: Description check

Explanation

The description explains the intermittent Windows CI timeouts, the new 30-second limits for tests and hooks on Windows, and the unchanged 5/10-second limits elsewhere. It also lists alternatives and verification steps. This is related to the changeset.

Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
Simplify code

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: dc59a35d-fdbe-4f15-a617-0501be433c76
Commits

Reviewing files that changed from the base of the PR and between 114b1ec and 14144dd.

Files selected for processing: 1

  • packages/cli/vitest.config.ts

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

@wmadden-electric
wmadden-electric enabled auto-merge (squash) November 27, 2026 08:22
@pkg-pr-new

pkg-pr-new Bot commented Nov 27, 2026

Copy link
Copy Markdown

Open in StackBlitz

npx https://pkg.pr.new/@prisma/cli@411
npx https://pkg.pr.new/@prisma/cli-engine@411

commit: 14144dd

@wmadden-electric
wmadden-electric merged commit 619abb4 into main Nov 27, 2026
16 checks passed
@wmadden-electric
wmadden-electric deleted the fix/skills-sync-windows-timeout branch November 27, 2026 08:24
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