Skip to content

Custom JS functions always time out after the hardcoded 5s default regardless of the --timeout value. #962

Description

@michalbiesek

Minimum repro: https://github.com/michalbiesek/vacuum-nodejs-repro

git clone git@github.com:michalbiesek/vacuum-nodejs-repro.git
cd vacuum-nodejs-repro
npm install
npx vacuum lint -r ruleset.yaml -f functions --timeout 30 spec.yaml --no-clip -d --no-banner --no-style

Expected: lint completes (30s timeout > 6s function execution).
Actual: ✗ JavaScript function 'slow' timed out after 5s

Observed behavior

┌───────────┬───────────────────────────────────────────────────────────┐
│ --timeout │                          Result                           │
├───────────┼───────────────────────────────────────────────────────────┤
│ 1         │ Rule timed out, skipping ~1.3s (rule-level timeout works) │
├───────────┼───────────────────────────────────────────────────────────┤
│ 3         │ Rule timed out, skipping ~3.6s                            │
├───────────┼───────────────────────────────────────────────────────────┤
│ 6+        │ JS function timed out after 5s (ignores flag)             │
└───────────┴───────────────────────────────────────────────────────────┘

Root cause

RuleSetExecution.Timeout is set from --timeout, but JSRuleFunction.ruleTimeout stays at DefaultRuleTimeout (5s) —
nothing calls SetTimeout() on loaded JS functions before execution.

Environment

- vacuum 0.30.1 (also 0.26.5)
- macOS arm64
- @quobix/vacuum npm package

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions