test(snapshots): kill the real vp process in env_install_interrupt - #2316
Merged
Conversation
✅ Deploy Preview for viteplus-preview canceled.
|
fengmk2
force-pushed
the
deflake-env-install-interrupt
branch
from
August 4, 2026 03:38
58e9db5 to
5473d17
Compare
Member
Author
|
I will retry many times before merge. |
Member
Author
|
Attempt 10 is green and the whole CI run now concludes success |
On Windows, `vp` on PATH is the trampoline in VP_HOME/bin, which runs current/bin/vp.exe as a child and waits. The interrupt driver's child.pid was the trampoline, so the kill order from #2299 killed the wrong process first: the real vp.exe was torn down by `taskkill /T`, which kills the tree in unspecified order. Whenever the npm subtree died before vp.exe, the still-alive vp treated the reinstall as failed and removed the partial install dir that the check-stale step asserts on. When child enumeration returned nothing, only the trampoline died and the real vp survived as an orphan, matching the observed zero-output timeout mode. Unix never flaked because bin/vp is a symlink, so the killed child is the installer. Spawn VP_HOME/current/bin/vp directly so child.pid is the process that runs the install on every platform, and kill the postinstall subtree via a PID handshake in the ready file instead of PowerShell/CIM enumeration. Stage markers and a 45s watchdog make any future failure name the stage that hung instead of leaving a blank PTY screen.
fengmk2
force-pushed
the
deflake-env-install-interrupt
branch
from
August 4, 2026 05:52
5473d17 to
a2e27bd
Compare
cpojer
approved these changes
Aug 4, 2026
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.
The Windows
env_install_interruptcase kept flaking after #2283 and #2299, in two modes: the check-stale step reported "interrupted stale package removed" instead of "exists", and a 60s zero-output step timeout.Root cause: on Windows,
vpon PATH is the trampoline inVP_HOME/bin, which runscurrent/bin/vp.exeas a child and waits. The interrupt driver'schild.pidwas the trampoline, so #2299 killed the wrong process first. The real vp.exe was then torn down bytaskkill /T, which kills the tree in unspecified order; whenever the npm subtree died before vp.exe, the still-alive vp treated the reinstall as failed and removed the partial install dir the test asserts on. When child enumeration returned nothing, only the trampoline died and the real vp survived as an orphan, matching the zero-output mode. Unix never flaked becausebin/vpis a symlink, so the killed child is the installer.Fix, all inside the fixture:
VP_HOME/current/bin/vp[.exe]directly sochild.pidis the process that runs the install on every platform; killing it first now prevents the cleanup reaction.Verified on macOS with
cargo test -p vite_cli_snapshots -- env_install_interrupt; the Windows race itself can only be exercised by this PR's Windows CLI snapshot leg.