mirror of
https://github.com/nodejs/node.git
synced 2026-11-27 17:52:27 -05:00
test: split test-perf-hooks-timerify
This test has been flaky in the CI. It squeezes too many independent test cases into one file, so split it up so that we can mark the persistent flaky test case and leave the unproblematic ones alone. PR-URL: https://github.com/nodejs/node/pull/60568 Refs: https://github.com/nodejs/node/issues/54803 Refs: https://github.com/nodejs/reliability/blob/main/reports/2025-11-03.md Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
1 parent
5efe4f722e
commit
22fd621daf
9 files changed
+178
-154
No files matched your search
@@ -0,0 +1,25 @@
|
||||
// Test basic functionality of timerify and PerformanceObserver.
|
||||
'use strict';
|
||||
|
||||
const common = require('../common');
|
||||
const assert = require('assert');
|
||||
const { timerify, PerformanceObserver } = require('perf_hooks');
|
||||
|
||||
// Verifies that `performance.timerify` is an alias of `perf_hooks.timerify`.
|
||||
assert.strictEqual(performance.timerify, timerify);
|
||||
|
||||
// Intentional non-op. Do not wrap in common.mustCall();
|
||||
const n = timerify(function noop() {});
|
||||
|
||||
const obs = new PerformanceObserver(common.mustCall((list) => {
|
||||
const entries = list.getEntries();
|
||||
const entry = entries[0];
|
||||
assert(entry);
|
||||
assert.strictEqual(entry.name, 'noop');
|
||||
assert.strictEqual(entry.entryType, 'function');
|
||||
assert.strictEqual(typeof entry.duration, 'number');
|
||||
assert.strictEqual(typeof entry.startTime, 'number');
|
||||
obs.disconnect();
|
||||
}));
|
||||
obs.observe({ entryTypes: ['function'] });
|
||||
n();
|
||||
Reference in new issue
Block a user