Skip to content

feat: support --segfault-retry=3 - #1854

Merged
antfu merged 7 commits into
mainfrom
feat/cli-wrapper
Aug 15, 2022
Merged

feat: support --segfault-retry=3#1854
antfu merged 7 commits into
mainfrom
feat/cli-wrapper

Conversation

@antfu

@antfu antfu commented Aug 15, 2022

Copy link
Copy Markdown
Member

Context: vitejs/vite#9508

Changes:

  • Wrapper the main CLI in a child_process
  • Supported --segfault-retry CLI flag and VITEST_SEGFAULT_RETRY env
  • When retries set but still detecting the segfault, a tip will be displayed

image

Co-authored-by: tony19 tony19@users.noreply.github.com

@antfu
antfu requested a review from sheremet-va August 15, 2022 09:03
main()

async function start(args: string[]) {
const child = execa('node', [fileURLToPath(ENTRY), ...args], {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't it hurt performance for "--segfault-retry=1" that we always starts a child process? Shouldn't we just import ./cli.mjs in this case?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, but we can't show useful error message that way 🤔

I guess it's ok for now.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't count how many times we invoke vitest in our test, but at the high level, it doesn't make CI time increase. Using this would allow us to provide information about the segfault reasoning and issue link.

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.

2 participants