Skip to content

docs: document Deno.test() timeout option#3102

Merged
bartlomieju merged 3 commits into
2.8from
docs/test-timeout-option
May 20, 2026
Merged

docs: document Deno.test() timeout option#3102
bartlomieju merged 3 commits into
2.8from
docs/test-timeout-option

Conversation

@bartlomieju
Copy link
Copy Markdown
Member

Summary

  • Add a "Timeouts" section to the testing fundamentals page
    documenting the per-test timeout option for Deno.test()
  • Covers async hangs, sync hot loops, and the timeout: 0
    disable behavior

Corresponds to denoland/deno#33815.

Copy link
Copy Markdown
Contributor

@fibibot fibibot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wording on the timeout option, 0/unset semantics, and "next test still runs" match the upstream PR (denoland/deno#33815) — the spec tests async_hang.out and sync_hot_loop.out assert that exact behavior, and the new docstring on Deno.TestDefinition.timeout in lib.deno.ns.d.ts says the same thing.

One claim I'd like to confirm before approving: "Sanitizers are skipped for the timed-out test since a forcibly terminated test will naturally have leaked resources or operations." That's not in the upstream TS docstring, and I don't see explicit TimedOut-aware branching around the sanitizer pass in cli/tools/test/mod.rs. Can you point at where this happens, or soften the claim if it's an inference about what users will observe rather than a guaranteed behavior?

Holding approval until lint and link check is green (currently CANCELLED on this SHA — needs a re-run).

Copy link
Copy Markdown
Contributor

@fibibot fibibot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified the sanitizer-skip claim against upstream spec tests/specs/test/timeout/async_hang.ts — the pending setTimeout(resolve, 1_000_000) would surface as an op-sanitizer failure if sanitizers ran on the timed-out test, but async_hang.out only shows error: Test timed out after 100ms. with no sanitizer output. The doc statement matches observed behavior. CI green; approving.

@bartlomieju bartlomieju changed the base branch from main to 2.8 May 20, 2026 13:02
Adds a "Timeouts" section to the testing fundamentals page
covering the per-test `timeout` option from denoland/deno#33815.
@bartlomieju bartlomieju force-pushed the docs/test-timeout-option branch from c0c9d20 to fb4a3c3 Compare May 20, 2026 13:07
@bartlomieju bartlomieju merged commit 23fe2be into 2.8 May 20, 2026
1 check was pending
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants