Repository navigation
Conversation
hi-ogawa
changed the base branch from
feat/node-trace-timeline
to
feat/trace-timeline-wait-message
October 27, 2026 07:06
✅ Deploy Preview for vitest-dev ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
hi-ogawa
force-pushed
the
feat/trace-timeline-hooks
branch
from
November 2, 2026 07:08
c0ac9d4 to
846cae0
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
WIP 🤖
Slow setup is a common cause of a timeout that gets blamed on the test body, but a timeline that only shows polls and waits has nothing to say about it. With this PR,
experimental.traceTimelinealso records the hooks and fixtures that run for each test attempt, so the timeline shows where the time went before and during the test body.The recorded steps are
beforeEachand its returned cleanup,afterEach,aroundEachsetup and teardown,onTestFinished,onTestFailed, and fixture setup and teardown. Each step points at where the hook ortest.extendwas called, and a poll, wait, or fixture that runs inside a hook nests under it. Hooks know their test exactly, so they are attributed correctly undertest.concurrenttoo. The attempt now starts beforearoundEachand ends after its fixtures are torn down, so the whole attempt is covered.Steps after the test body, such as
afterEach, fixture teardown, andonTestFinished, are printed in the terminal only when they fail or don't finish. They can't cause a test timeout and rarely explain the failure, but they would push the setup and poll steps out of the 10-step limit. The recorded trace still keeps them, with avitest:onTaskFinishedentry that marks where the test body ended, so a trace viewer can show them all.beforeAllandafterAllare not recorded, because they run once per suite rather than per attempt, and a failure there is reported on the suite, which has no timeline. Browser mode is unchanged, because the option has no effect there andbrowser.traceViewdoes not record hooks either.The option still adds no measurable cost to passing tests. On 20,000 passing tests that each run
aroundEach,beforeEachwith cleanup,afterEach, a fixture, andonTestFinished(one worker, 8 interleaved runs), the run took 2.31s on average with the option off and 2.32s with it on, which is within run-to-run noise.