Repository navigation
Slow Windows CI runs no longer fail main: tests and hooks get 30 seconds on Windows - #411
Merged
Merged
Conversation
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>
wmadden-electric
enabled auto-merge (squash)
November 27, 2026 08:22
commit: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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. Inpackages/cli/vitest.config.ts: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
Testworkflow runspackages/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:tests/init.test.tstests/credential-manager.test.tstests/spawn-adapter.test.tstests/skills-sync.test.tsIn 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:
tests/credential-manager.test.tswent from 3.4 to 16.2 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 (
ENOTEMPTYwhile 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.tspasses locally with the new config.tests/auth.test.ts, is for a test that waits on a fixed 3-second timer.pnpm --filter @prisma/cli test, which loads this config. This pull request's own Windows run is the first run with it.Alternatives considered
mainwas fixed on 2026-11-26. But each failure still costs someone time to look into.retry). It would hide real failures that happen only some of the time, not just slow runs.CIis set. A developer's Windows machine can slow down in the same way, and a higher limit costs nothing while tests are fast.Agent: orpheus-67