Skip to content
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

fix: cleanup vitest in public resolveConfig API #7623

Merged
merged 4 commits into from
Mar 7, 2025

Conversation

hi-ogawa
Copy link
Contributor

@hi-ogawa hi-ogawa commented Mar 7, 2025

Description

Currently we get a huge wall of logs like this https://github.com/vitest-dev/vitest/actions/runs/13711813132/job/38349623334?pr=7621#step:8:458

⎯⎯⎯⎯ Unhandled Rejection ⎯⎯⎯⎯⎯
Error: intentional unhandled rejection
 ❯ fixtures/unhandled-rejections/setup-unhandled-rejections.ts:2:42
 ❯ Object.setup fixtures/unhandled-rejections/setup-unhandled-rejections.ts:2:8
 ❯ TestProject._initializeGlobalSetup ../../packages/vitest/dist/chunks/cli-api.DIBEqC3b.js:10464:53
 ❯ Vitest.initializeGlobalSetup ../../packages/vitest/dist/chunks/cli-api.DIBEqC3b.js:12943:7
 ❯ ../../packages/vitest/dist/chunks/cli-api.DIBEqC3b.js:12854:9
 ❯ Vitest.runFiles ../../packages/vitest/dist/chunks/cli-api.DIBEqC3b.js:12883:12
 ❯ Vitest.start ../../packages/vitest/dist/chunks/cli-api.DIBEqC3b.js:12764:21
 ❯ startVitest ../../packages/vitest/dist/chunks/cli-api.DIBEqC3b.js:13910:7
 ❯ runVitest ../test-utils/index.ts:76:11

Some are due to test not doing proper cleanup. Also public resolveConfig API had hanging new Vitest, so I made it close properly.

I fixed all except these two https://github.com/vitest-dev/vitest/actions/runs/13712690144/job/38352041269?pr=7623#step:8:457, which can be reproduce by

pnpm -C test/config test run /unhandled /override
...
  Error: intentional unhandled rejection
  Error: intentional unhandled rejection

Probably this is due to error handler not cleaned up when resolve config is throwing. It should be fixed, but I guess we can deal with this later.

await expect(async () => {
await config(rawConfig.options)
}).rejects.toThrowError(`Inspector host cannot be a URL. Use "host:port" instead of "${url}"`)

Please don't delete this checklist! Before submitting the PR, please make sure you do the following:

  • It's really useful if your PR references an issue where it is discussed ahead of time. If the feature is substantial or introduces breaking changes without a discussion, PR might be closed.
  • Ideally, include a test that fails without this PR but passes with it.
  • Please, don't make changes to pnpm-lock.yaml unless you introduce a new test example.

Tests

  • Run the tests with pnpm test:ci.

Documentation

  • If you introduce new functionality, document it. You can run documentation with pnpm run docs command.

Changesets

  • Changes in changelog are generated from PR name. Please, make sure that it explains your changes in an understandable manner. Please, prefix changeset messages with feat:, fix:, perf:, docs:, or chore:.

Sorry, something went wrong.

hi-ogawa added 3 commits March 7, 2025 11:09

Verified

This commit was signed with the committer’s verified signature.
saitonakamura Michael サイトー 中村 Bashurov

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
@hi-ogawa hi-ogawa changed the title test: tweak test/config suite test: cleanup resources in test/config suite Mar 7, 2025
@hi-ogawa hi-ogawa changed the title test: cleanup resources in test/config suite fix: cleanup vitest in public resolveConfig Mar 7, 2025
@hi-ogawa hi-ogawa changed the title fix: cleanup vitest in public resolveConfig fix: cleanup vitest in public resolveConfig API Mar 7, 2025
@hi-ogawa hi-ogawa marked this pull request as ready for review March 7, 2025 03:01
@sheremet-va sheremet-va merged commit db14ab7 into vitest-dev:main Mar 7, 2025
9 of 13 checks passed
@hi-ogawa hi-ogawa deleted the test-tweak-config-suite branch March 7, 2025 07:37
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.

None yet

2 participants