test: fix flaky test-performance-eventloopdelay · nodejs/node@06513f5 · GitHub
Skip to content

Commit 06513f5

Browse files
mcollinaaduh95
authored andcommitted
test: fix flaky test-performance-eventloopdelay
The test was flaky because the histogram sampling might not have completed before the assertions ran. By using setImmediate before disabling the histogram and checking values, we give the event loop a chance to record final samples on slower systems. Also added an explicit check for histogram.count > 0 to provide a clearer error message if no samples are recorded. Refs: nodejs/reliability#1450 PR-URL: #61629 Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com>
1 parent 17b363a commit 06513f5

1 file changed

Lines changed: 40 additions & 35 deletions

File tree

test/sequential/test-performance-eventloopdelay.js

Lines changed: 40 additions & 35 deletions

0 commit comments

Comments
 (0)