Skip to content

slowTestThreshold: Infinity triggers Node's TimeoutOverflowWarning #10155

@AriPerkkio

Description

@AriPerkkio

Describe the bug

Noticed a user using slowTestThreshold with Infinity, probably to avoid seeing any reporter warnings.

const timeout = setTimeout(() => {
hook.visible = true
}, this.ctx.config.slowTestThreshold).unref()

(node:96948) TimeoutOverflowWarning: Infinity does not fit into a 32-bit signed integer.
Timeout duration was set to 1.
    at new Timeout (node:internal/timers:179:17)
    at setTimeout (node:timers:138:19)
    at SummaryReporter.onHookStart (file:///x/node_modules/vitest/dist/chunks/index.DWDW6mLz.js:1134:19)
    at TreeReporter.onHookStart (file:///x/node_modules/vitest/dist/chunks/index.DWDW6mLz.js:1323:17)
    at file:///x/node_modules/vitest/dist/chunks/cli-api.CdZ6wo9-.js:12544:56
    at Array.map (<anonymous>)
    at Vitest.report (file:///x/node_modules/vitest/dist/chunks/cli-api.CdZ6wo9-.js:12544:36)
    at TestRun.reportEvent (file:///x/node_modules/vitest/dist/chunks/cli-api.CdZ6wo9-.js:11475:52)
    at TestRun.updated (file:///x/node_modules/vitest/dist/chunks/cli-api.CdZ6wo9-.js:11403:54)
    at processTicksAndRejections (node:internal/process/task_queues:105:5)
    at Proxy.onTaskUpdate (file:///x/node_modules/vitest/dist/chunks/cli-api.CdZ6wo9-.js:7076:9)
    at EventEmitter.onMessage (file:///x/node_modules/vitest/dist/chunks/index.0kCJoeWi.js:157:20)

Reproduction

https://stackblitz.com/~/edit/vitest-dev-vitest-uggyc9t9?file=vite.config.ts:L11&initialPath=/__vitest__/

System Info

Stackblitz

Used Package Manager

npm

Validations

Metadata

Metadata

Assignees

No one assigned

    Labels

    p1-choreDoesn't change code behavior (priority)

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions