Skip to content

Give defaults to the built-in default query test a 20s timeout#4268

Merged
trevor-scheer merged 1 commit into
graphql:mainfrom
trevor-scheer:trevor/vitest-monaco-cold-boot-timeout
May 14, 2026
Merged

Give defaults to the built-in default query test a 20s timeout#4268
trevor-scheer merged 1 commit into
graphql:mainfrom
trevor-scheer:trevor/vitest-monaco-cold-boot-timeout

Conversation

@trevor-scheer
Copy link
Copy Markdown
Contributor

@trevor-scheer trevor-scheer commented May 14, 2026

Summary

Times out at the default 9s on every CI run since Vitest 4 landed (#4260). It's the only test in GraphiQL.spec.tsx that boots Monaco's editorWorkerService from a cold start; the rest get a warm worker. Vitest 4's pool switch from threads to forks pushed cold-boot just past 9s.

Bumped to 20s on this one test, with an inline comment explaining why for the next person.

Failed on two back-to-back runs of an unrelated PR:

Monaco's editor worker cold start takes longer under Vitest 4's `forks` pool,
causing this test to time out at the default 9s in CI.
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented May 14, 2026

⚠️ No Changeset found

Latest commit: 9ff516a

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@trevor-scheer trevor-scheer marked this pull request as ready for review May 14, 2026 19:07
@trevor-scheer trevor-scheer enabled auto-merge (squash) May 14, 2026 19:08
@trevor-scheer trevor-scheer merged commit 1e608ea into graphql:main May 14, 2026
13 checks passed
@trevor-scheer trevor-scheer deleted the trevor/vitest-monaco-cold-boot-timeout branch May 14, 2026 19:12
trevor-scheer added a commit that referenced this pull request May 14, 2026
…4270)

## Summary

Follow-up to #4268. That PR bumped `testTimeout` to 20s for this test
but missed the second 9s ceiling: `configure({ asyncUtilTimeout: 9_000
})` in `packages/graphiql/setup-files.ts`. RTL's `waitFor` gives up at
the asyncUtilTimeout regardless of how big the `it()` timeout is — its
final assertion then runs against a `null` `queryEditor` and fails with
`expect(...).toBeVisible()` instead of the original "Test timed out"
message.

Evidence the previous fix was luck-of-the-draw: #4268 passed because
Monaco cold-booted at 7927ms — 73ms under the 9s cliff. #4266 failed at
9066ms on the same fix because Monaco took longer that run.

This PR adds `{ timeout: 15_000 }` to the `waitFor(...)` call so the
polling window matches the test's 20s ceiling. Keeps `it(..., 20000)` so
the two timeouts don't race in the other direction.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant