Vitest timeout in versions > 10.3.0-alpha.1 #34497
Unanswered
jorgenskogmo
asked this question in
Migrations
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Running the vitests via the "Run tests" panel in my storybook with ≈ 460 stories worked fine in v10.1.11, v10.2.0 and 10.3.0-alpha.1, but times out in newer 10.3.x releases.
Seems the regression was introduced in PR #33206 ("Addon-Vitest: Add channel API to programmatically trigger test runs"), which shipped in v10.3.0.
In v10.1.11, currentRun in the store state only held scalar counters. Status objects and a11y reports went to separate lightweight status stores. In v10.3.0+, three new fields were added to currentRun:
// These grow unboundedly via .concat() on every 500ms throttled flush
componentTestStatuses: s.currentRun.componentTestStatuses.concat(componentTestStatuses),
a11yStatuses: s.currentRun.a11yStatuses.concat(a11yStatuses),
a11yReports: {
...s.currentRun.a11yReports,
...a11yReportsByStoryId, // full axe-core results per story
},
The UniversalStore.setState() sends the entire state object (not diffs) via telejson.stringify() over the WebSocket channel. With 464 stories + a11y, each axe-core report is 50-200KB of JSON. That's ~23-93MB of a11yReports alone in the currentRun state, serialized repeatedly every 500ms during the run and again at TEST_RUN_COMPLETED. The repeated full-state serialization of ever-growing arrays blows past 3.7GB and is causing OOM crash in the node process.
Beta Was this translation helpful? Give feedback.
All reactions