test(cli): retry flaky subprocess evaluations in CI - #5909
Open
vianmora wants to merge 1 commit into
Open
Conversation
The evaluations/high-impact/* tests spawn CLI subprocesses (cold-started via tsx) and occasionally exceed the 15s timeout on a loaded runner, failing fixture-api.test.ts with a spurious timeout that passes on re-run. Add retry: 2 in CI (retry: 0 locally) so a transient timeout is absorbed; a real failure still fails every attempt. The defineConfig import switches to vitest/config (a superset of vite's; the build block is unaffected) so the test field type-checks.
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.
Description
The CLI evaluation tests under
packages/cli/evaluations/high-impact/*spawn real CLI subprocesses (cold-started throughtsx) against a local fixture API. On a loaded CI runner those cold starts occasionally exceed the default 15s test timeout, sofixture-api.test.tsfails withTest timed out in 15000mseven though nothing is broken. Re-running the same commit passes. It is a timing/flaky failure, not a regression.This adds a CI-only test retry so a transient timeout is absorbed instead of turning the whole run red and requiring a manual re-run:
retry: 0).defineConfigimport moves fromvitetovitest/config(a superset; the existingbuildblock is unaffected) so thetestfield type-checks.packages/cli/vite.config.tsbecause that is the config Vitest loads for this package. Atest.retryin the rootvitest.config.tsdoes not reach it (verified locally with a probe test: the root value is ignored, the package-local one takes effect).Steps for reproduction
pnpm --filter=webstudio test.evaluations/high-impact/fixture-api.test.tsfails withTest timed out in 15000ms; a re-run passes.CI=1, the transient timeout is retried up to 2x instead of failing the run.Code Review
Before requesting a review
Before merging
.envfile (none added;process.env.CIis set by CI providers)