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

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

Merged
merged 7 commits into from
Aug 15, 2022
Merged

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

merged 7 commits into from
Aug 15, 2022

Conversation

antfu
Copy link
Member

@antfu antfu commented Aug 15, 2022

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
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
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
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