You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Timeout diagnostics lose the promise a hung test awaits once it is garbage-collected #217
When a test or a beforeAll / afterAll hook times out, its error lists the promises it created that are still pending. Since #143 the tracker drops a promise's record as soon as a FinalizationRegistry reports the promise collected. A promise nobody can resolve, await new Promise(() => {}) being the usual cause of a hang, is unreachable while the test waits on it, so a garbage collection inside the timeout window removes the one record the diagnostics exist to show.
runner-context.test.ts's two timeout cases assert that record, and they fail at random:
On a Windows host runner-context.test.ts failed 2 of 12 runs of main this way.
I have a fix that keeps the record of a collected promise while the test or hook that created it can still time out, and releases it when that window closes. I can open a PR.
System Info
System:
OS: Windows 11 10.0.26200
Binaries:
Node: 26.8.1
Run pnpm exec vitest run src/__tests__/runner-context.test.ts in packages/runtime a few times.
"fails the suite when beforeAll times out and skips its tests" or "fails the timed-out test and skips the rest of the file" fails now and then with "items": [].
Activity
fix(runtime): keep pending promise records for hung tests during time…