docs: document Deno.test() timeout option#3102
Conversation
fibibot
left a comment
There was a problem hiding this comment.
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).
fibibot
left a comment
There was a problem hiding this comment.
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.
Adds a "Timeouts" section to the testing fundamentals page covering the per-test `timeout` option from denoland/deno#33815.
c0c9d20 to
fb4a3c3
Compare
Summary
documenting the per-test
timeoutoption forDeno.test()timeout: 0disable behavior
Corresponds to denoland/deno#33815.