-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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(runner): show stacktrace on hook timeout error #7502
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for vitest-dev ready!Built without sensitive environment variables
To edit notification comments on pull requests, go to your Netlify site configuration. |
isHook ? 'Hook' : 'Test' | ||
} timed out in ${timeout}ms.\nIf this is a long-running ${ | ||
isHook ? 'hook' : 'test' | ||
}, pass a timeout value as the last argument or configure it globally with "${ | ||
isHook ? 'hookTimeout' : 'testTimeout' | ||
}".` | ||
const error = new Error(message) |
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.
wouldn't it be more performant to change the message and stack trace of the original error instead of generating two stack traces?
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.
Since we don't read this new error's error.stack
, prepareStackTrace
rewriting only applies to
stackTraceError.stack
, so this won't matter for the performance.
I realized that we reuse a single stackTraceError.stack
for potential multiple hook timeout errors from the same beforeEach
, so mutating the original stackTraceError
isn't probably good.
If we go extreme, we can return a plain object from runner like { message, stack }
, but I don't think that's necessary.
Description
Please don't delete this checklist! Before submitting the PR, please make sure you do the following:
pnpm-lock.yaml
unless you introduce a new test example.Tests
pnpm test:ci
.Documentation
pnpm run docs
command.Changesets
feat:
,fix:
,perf:
,docs:
, orchore:
.