-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
fix: prevent vitest from hanging when using cloudflare/cloudflare-workers #12306
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
🦋 Changeset detectedLatest commit: 0faac07 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
| plugins: [sveltekit()], | ||
| test: { | ||
| include: ['src/**/*.{test,spec}.{js,ts}'], | ||
| // https://github.com/sveltejs/kit/issues/12305 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this comment is confusing. it seems to be saying that the teardownTimeout option is added to workaround issue #12305. however, that issue would be closed by this PR. can you add some text to go with the link and give some context?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@benmccann Actually this is not necessary at all. It has the default value of 10000 or 10 seconds. I didn't want to make the test take 10 seconds longer, which happens when this fix goes broken and the test case fails. Do you think I can remove this entirely, or should I write in detail why I specified smaller value than the default in this case?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I took the former approach, i.e. removing the timeout field.
|
@benmccann Hi, here's a friendly reminder about this PR. |
|
Thank you for the PR - we went with #12830 instead, so closing this one. |
Adapter.emulateis a property used foradapter-cloudflareandadapter-cloudflare-workers. Because it is invoked earlier than needed,vitestruns hang as theMiniflareinstance is not released. This PR makesAdapter.emulatorcalled right before its return value is needed.prerendercode is changed too, but it seems thatadapter-cloudflare/cloudflare-workersdon't allow pages to be prerendered. Return type ofdevwas changed because of ESLint error banningasyncfunctions without anyawaits. It still returns an allowed type.To make sure
dev/previewserver works with no problems, I've visually checked the rendered output ofpackages/kit/test/apps/cloudflareby runningdevandbuild/preview. Also I've added a Playwright test to make sure the page is properly rendered and able to connect to Cloudflare KV namespaces.Fixes #12305.
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
Tests
pnpm testand lint the project withpnpm lintandpnpm checkChangesets
pnpm changesetand following the prompts. Changesets that add features should beminorand those that fix bugs should bepatch. Please prefix changeset messages withfeat:,fix:, orchore:.Edits