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

Commit 23d1ecf

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 e71e950 commit 23d1ecf

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)