test: deflake version preview deletion lifecycle test
Merged
AZ
2d ago+5+5+0123456789-2-2-0123456789
Fixes a flaky assertion in version_preview_deletion.integration.test.ts that failed unit-tests-macos on main (run 45330878050) with expected 'resolving-origin' to be 'checking-out'.
After SELECT_VERSION, the actor resolves the origin branch before checkout. That path calls assertAppGitRepository, which runs a real fs.promises.stat on the temp .git folder on the libuv threadpool. The test assumed one flush() (two microtasks plus a setTimeout(0)) was enough for that stat to finish, which isn't guaranteed on a loaded runner. The first assertion now uses vi.waitFor instead.
Things to check:
- Only the first wait changed. After it, the checkout, restart, and return steps go straight to mocks with no filesystem access, so their
flush()calls are still deterministic. - I kept the real
.gitcheck rather than mockingassertAppGitRepository, so the integration test still exercises origin resolution against a real folder. - I reproduced the CI failure locally by adding a 10 ms delay to the stat; with this change the test passes under that delay.
#skip-bugbot
š¤ Generated with Claude Code