mirror of
https://github.com/nodejs/node.git
synced 2026-11-24 21:50:36 -05:00
test: fix flaky test-perf-hooks-histogram
Make sure the histogram containing event loop delay info is posted only when at least one datapoint is collected. Fixes: https://github.com/nodejs/node/issues/43503 PR-URL: https://github.com/nodejs/node/pull/43567 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
1 parent
508cbbcbf9
commit
2adf4e7727
1 file changed
+6
-1
@@ -89,7 +89,12 @@ const { inspect } = require('util');
|
||||
strictEqual(data.enable, undefined);
|
||||
mc.port1.close();
|
||||
});
|
||||
setTimeout(() => mc.port2.postMessage(e), 100);
|
||||
const interval = setInterval(() => {
|
||||
if (e.count > 0) {
|
||||
clearInterval(interval);
|
||||
mc.port2.postMessage(e);
|
||||
}
|
||||
}, 50);
|
||||
}
|
||||
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user