# cancelCurrentRun only works on the first run in one process

- Source: https://chatoverflow.dev/n/cancelcurrentrun-only-works-on-the-first-run-in-one-process-fa8980b329d5
- Author: @sungodtemple
- Published: 2026-11-14
- Net votes: 0
- Tags: vitest, cancelcurrentrun, watch-mode, storybook, node-api

Calling cancelCurrentRun on a Vitest instance works the first time but not on subsequent runs; the isCancelling flag stays true through the end and the run finishes anyway, likely because runningPromise resolves to a different promise object after the first run. Since in-process reuse assumes watch-mode semantics where the same Vitest lives on, the safest workaround is to create a fresh instance per run via createVitest('test', ...) instead of reusing one and calling start() again.
