node/test/async-hooks
Joyee Cheung 8c380ded46
async_hooks: add trackPromises option to createHook()
This adds a trackPromises option that allows users to completely opt
out of the promise hooks that are installed whenever an async hook is
added. For those who do not need to track promises, this avoids
the excessive hook invocation and the heavy overhead from it.

This option was previously already implemented internally to skip the
noise from promise hooks when debugging async operations via the
V8 inspector. This patch just exposes it.

PR-URL: https://github.com/nodejs/node/pull/61415
Refs: https://github.com/nodejs/node/pull/57148
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
2026-01-28 11:25:24 +00:00
..
async-hooks.status test: aix: mark test-emit-on-destroyed as flaky 2026-01-16 11:16:59 +00:00
coverage.md doc: format markdown files in test directory 2021-10-04 20:19:11 -07:00
hook-checks.js test: ensure assertions are reachable in test/async-hooks 2025-10-09 21:57:24 +00:00
init-hooks.js test: rely less on duplicative common test harness utilities 2025-01-25 07:23:09 +00:00
test-async-await.js test: add trailing commas in async-hooks tests (#45549) 2022-11-21 18:43:47 +01:00
test-async-exec-resource-http-32060.js test: ensure assertions are reachable in test/async-hooks 2025-10-09 21:57:24 +00:00
test-async-exec-resource-http-agent.js test: add http agent to executionAsyncResource 2024-05-11 10:45:09 +02:00
test-async-exec-resource-http.js test: ensure assertions are reachable in test/async-hooks 2025-10-09 21:57:24 +00:00
test-async-exec-resource-match.js test: add trailing commas in async-hooks tests (#45549) 2022-11-21 18:43:47 +01:00
test-async-local-storage-args.js test: ensure assertions are reachable in test/async-hooks 2025-10-09 21:57:24 +00:00
test-async-local-storage-async-await.js
test-async-local-storage-async-functions.js
test-async-local-storage-dgram.js test: ensure assertions are reachable in test/async-hooks 2025-10-09 21:57:24 +00:00
test-async-local-storage-enable-disable.js test: ensure assertions are reachable in test/async-hooks 2025-10-09 21:57:24 +00:00
test-async-local-storage-enter-with.js test: ensure assertions are reachable in test/async-hooks 2025-10-09 21:57:24 +00:00
test-async-local-storage-errors.js test: enforce better never-settling-promise detection 2025-12-10 23:55:36 +00:00
test-async-local-storage-gcable.js test: ensure assertions are reachable in test/async-hooks 2025-10-09 21:57:24 +00:00
test-async-local-storage-http-agent.js test: ensure assertions are reachable in test/async-hooks 2025-10-09 21:57:24 +00:00
test-async-local-storage-http.js test: ensure assertions are reached on more tests 2025-11-11 09:56:18 +00:00
test-async-local-storage-misc-stores.js test: ensure assertions are reachable in test/async-hooks 2025-10-09 21:57:24 +00:00
test-async-local-storage-nested.js test: ensure assertions are reachable in test/async-hooks 2025-10-09 21:57:24 +00:00
test-async-local-storage-no-mix-contexts.js test: ensure assertions are reachable in test/async-hooks 2025-10-09 21:57:24 +00:00
test-async-local-storage-promises.js test: enforce better never-settling-promise detection 2025-12-10 23:55:36 +00:00
test-async-local-storage-socket.js test: ensure assertions are reachable in test/async-hooks 2025-10-09 21:57:24 +00:00
test-async-local-storage-stream-finished.js test: ensure assertions are reachable in test/async-hooks 2025-10-09 21:57:24 +00:00
test-async-local-storage-thenable.js test: enforce better never-settling-promise detection 2025-12-10 23:55:36 +00:00
test-async-local-storage-tlssocket.js test: ensure assertions are reachable in test/async-hooks 2025-10-09 21:57:24 +00:00
test-async-wrap-providers.js async_hooks: expose async_wrap providers 2021-11-12 21:48:34 +00:00
test-callback-error.js test: add escapePOSIXShell util 2024-09-29 20:44:52 +00:00
test-crypto-pbkdf2.js test: rely less on duplicative common test harness utilities 2025-01-25 07:23:09 +00:00
test-crypto-randomBytes.js test: rely less on duplicative common test harness utilities 2025-01-25 07:23:09 +00:00
test-destroy-not-blocked.js test: enforce better never-settling-promise detection 2025-12-10 23:55:36 +00:00
test-disable-in-init.js test: add trailing commas in async-hooks tests (#45549) 2022-11-21 18:43:47 +01:00
test-embedder.api.async-resource-no-type.js test: add trailing commas in async-hooks tests (#45549) 2022-11-21 18:43:47 +01:00
test-embedder.api.async-resource.js test: add trailing commas in async-hooks tests (#45549) 2022-11-21 18:43:47 +01:00
test-embedder.api.async-resource.runInAsyncScope.js
test-emit-after-on-destroyed.js test: improve flakiness detection on stack corruption tests 2025-06-08 13:17:08 +00:00
test-emit-before-after.js test: add trailing commas in async-hooks tests (#45549) 2022-11-21 18:43:47 +01:00
test-emit-before-on-destroyed.js test: add trailing commas in async-hooks tests (#45549) 2022-11-21 18:43:47 +01:00
test-emit-init.js test: add trailing commas in async-hooks tests (#45549) 2022-11-21 18:43:47 +01:00
test-enable-disable.js test: rely less on duplicative common test harness utilities 2025-01-25 07:23:09 +00:00
test-enable-in-init.js test: add trailing commas in async-hooks tests (#45549) 2022-11-21 18:43:47 +01:00
test-filehandle-no-reuse.js test: ensure assertions are reachable in test/async-hooks 2025-10-09 21:57:24 +00:00
test-fseventwrap.js test: rely less on duplicative common test harness utilities 2025-01-25 07:23:09 +00:00
test-fsreqcallback-access.js
test-fsreqcallback-readFile.js test: rely less on duplicative common test harness utilities 2025-01-25 07:23:09 +00:00
test-getaddrinforeqwrap.js test: rely less on duplicative common test harness utilities 2025-01-25 07:23:09 +00:00
test-getnameinforeqwrap.js test: rely less on duplicative common test harness utilities 2025-01-25 07:23:09 +00:00
test-graph.fsreq-readFile.js test: add trailing commas in async-hooks tests (#45549) 2022-11-21 18:43:47 +01:00
test-graph.http.js test: add trailing commas in async-hooks tests (#45549) 2022-11-21 18:43:47 +01:00
test-graph.intervals.js test: add trailing commas in async-hooks tests (#45549) 2022-11-21 18:43:47 +01:00
test-graph.pipe.js test: add trailing commas in async-hooks tests (#45549) 2022-11-21 18:43:47 +01:00
test-graph.pipeconnect.js test: add trailing commas in async-hooks tests (#45549) 2022-11-21 18:43:47 +01:00
test-graph.shutdown.js test: add trailing commas in async-hooks tests (#45549) 2022-11-21 18:43:47 +01:00
test-graph.signal.js test: rely less on duplicative common test harness utilities 2025-01-25 07:23:09 +00:00
test-graph.statwatcher.js test: add trailing commas in async-hooks tests (#45549) 2022-11-21 18:43:47 +01:00
test-graph.tcp.js test: add trailing commas in async-hooks tests (#45549) 2022-11-21 18:43:47 +01:00
test-graph.timeouts.js test: add trailing commas in async-hooks tests (#45549) 2022-11-21 18:43:47 +01:00
test-graph.tls-write-12.js
test-graph.tls-write.js test: add trailing commas in async-hooks tests (#45549) 2022-11-21 18:43:47 +01:00
test-http-agent-handle-reuse-parallel.js test: ensure assertions are reachable in test/async-hooks 2025-10-09 21:57:24 +00:00
test-http-agent-handle-reuse-serial.js test: add trailing commas in async-hooks tests (#45549) 2022-11-21 18:43:47 +01:00
test-httpparser-reuse.js test: add trailing commas in async-hooks tests (#45549) 2022-11-21 18:43:47 +01:00
test-httpparser.request.js test: add trailing commas in async-hooks tests (#45549) 2022-11-21 18:43:47 +01:00
test-httpparser.response.js test: add trailing commas in async-hooks tests (#45549) 2022-11-21 18:43:47 +01:00
test-immediate.js
test-improper-order.js test: deflake async-hooks/test-improper-order on AIX 2025-06-10 16:43:28 +05:30
test-improper-unwind.js test: improve flakiness detection on stack corruption tests 2025-06-08 13:17:08 +00:00
test-late-hook-enable.js test: ensure assertions are reachable in test/async-hooks 2025-10-09 21:57:24 +00:00
test-net-get-connections.js
test-nexttick-default-trigger.js test: add trailing commas in async-hooks tests (#45549) 2022-11-21 18:43:47 +01:00
test-no-assert-when-disabled.js test: rely less on duplicative common test harness utilities 2025-01-25 07:23:09 +00:00
test-pipeconnectwrap.js
test-pipewrap.js test: rely less on duplicative common test harness utilities 2025-01-25 07:23:09 +00:00
test-promise.chain-promise-before-init-hooks.js test: enforce better never-settling-promise detection 2025-12-10 23:55:36 +00:00
test-promise.js test: enforce better never-settling-promise detection 2025-12-10 23:55:36 +00:00
test-promise.promise-before-init-hooks.js test: enforce better never-settling-promise detection 2025-12-10 23:55:36 +00:00
test-querywrap.js
test-queue-microtask.js test: add trailing commas in async-hooks tests (#45549) 2022-11-21 18:43:47 +01:00
test-shutdownwrap.js
test-signalwrap.js test: rely less on duplicative common test harness utilities 2025-01-25 07:23:09 +00:00
test-statwatcher.js test: ensure assertions are reachable in test/async-hooks 2025-10-09 21:57:24 +00:00
test-tcpwrap.js test: defer invocation checks 2022-11-05 19:53:24 +01:00
test-timers.setInterval.js
test-timers.setTimeout.js
test-tlswrap.js test: add trailing commas in async-hooks tests (#45549) 2022-11-21 18:43:47 +01:00
test-track-promises-default.js async_hooks: add trackPromises option to createHook() 2026-01-28 11:25:24 +00:00
test-track-promises-false-check.js async_hooks: add trackPromises option to createHook() 2026-01-28 11:25:24 +00:00
test-track-promises-false.js async_hooks: add trackPromises option to createHook() 2026-01-28 11:25:24 +00:00
test-track-promises-true.js async_hooks: add trackPromises option to createHook() 2026-01-28 11:25:24 +00:00
test-track-promises-validation.js async_hooks: add trackPromises option to createHook() 2026-01-28 11:25:24 +00:00
test-ttywrap.readstream.js test: add trailing commas in async-hooks tests (#45549) 2022-11-21 18:43:47 +01:00
test-udpsendwrap.js
test-udpwrap.js
test-unhandled-exception-valid-ids.js process: ignore asyncId 0 in exception handler 2022-01-18 22:05:12 +01:00
test-unhandled-rejection-context.js test: rely less on duplicative common test harness utilities 2025-01-25 07:23:09 +00:00
test-writewrap.js
test-zlib.zlib-binding.deflate.js test: add trailing commas in async-hooks tests (#45549) 2022-11-21 18:43:47 +01:00
testcfg.py
verify-graph.js test: ensure assertions are reachable in test/async-hooks 2025-10-09 21:57:24 +00:00