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

perf(utils): optimize parse stack trace regexp #6123

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

userquin
Copy link
Member

Description

closes #6039

Check https://github.com/userquin/vitest-stacktrace-issue-6039

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

Comment on lines 93 to 94
// eslint-disable-next-line regexp/no-super-linear-backtracking,regexp/no-misleading-capturing-group,regexp/no-unused-capturing-group
const matches = /(at\s+)?(async\s+)?([^\s@]+)?(?:@|\s+\()?([^\s()]+):(\d+):(\d+)\)?/.exec(line)
Copy link
Member

Choose a reason for hiding this comment

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

Disabling these ESLint rules is not convincing. Can we fix these errors as well?

Copy link
Member Author

Choose a reason for hiding this comment

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

can you check @AriPerkkio ? check also discord server, some hints there

Copy link
Member

@AriPerkkio AriPerkkio left a comment

Choose a reason for hiding this comment

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

We should add test case from #6039 that timeouts without this fix.

@userquin
Copy link
Member Author

userquin commented Jul 15, 2024

We should add test case from #6039 that timeouts without this fix.

Added a test in the test/browser folder: rn we cannot test the timeout since we need to add PW/WDIO test, and we have only PW/WDIO tests using happy-dom to test the ui.

If you want to test it, change test:browser:* scripts in test/browser/vite.config.mts and run them:

    "test:browser:preview": "BROWSER=firefox PROVIDER=preview vitest",
    "test:browser:playwright": "BROWSER=firefox PROVIDER=playwright vitest",
    "test:browser:webdriverio": "BROWSER=firefox PROVIDER=webdriverio vitest"

For example, running preview provider:
imagen

(check test/ui/test folder)

@sheremet-va
Copy link
Member

Seems like the current implementation breaks inline snapshots in the browser

@sheremet-va
Copy link
Member

sheremet-va commented Jul 22, 2024

Seems like the current implementation breaks inline snapshots in the browser

By "current", I mean this PR. It works fine in main.

@jrmdayn
Copy link

jrmdayn commented Sep 6, 2024

@userquin any luck fixing this issue? 🙏 🙏 🙏

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.

Performance issue when throwing errors that have stackTraceLimit = 0
4 participants