From 5936cef60aceace32c572f982bc1a094875238e7 Mon Sep 17 00:00:00 2001 From: James M Snell Date: Sat, 24 May 2025 16:30:31 -0700 Subject: [PATCH] test: add disposable histogram test PR-URL: https://github.com/nodejs/node/pull/58384 Reviewed-By: Yagiz Nizipli Reviewed-By: LiviaMedeiros Reviewed-By: Chengzhong Wu Reviewed-By: Matteo Collina --- test/parallel/test-perf-hooks-histogram.js | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/test/parallel/test-perf-hooks-histogram.js b/test/parallel/test-perf-hooks-histogram.js index 37fcdfb3fca..9e76cca2f4f 100644 --- a/test/parallel/test-perf-hooks-histogram.js +++ b/test/parallel/test-perf-hooks-histogram.js @@ -97,6 +97,17 @@ const { inspect } = require('util'); }, 50); } +{ + // Tests that the ELD histogram is disposable + let histogram; + { + using hi = monitorEventLoopDelay(); + histogram = hi; + } + // The histogram should already be disabled. + strictEqual(histogram.disable(), false); +} + { const h = createHistogram(); ok(inspect(h, { depth: null }).startsWith('Histogram'));