From b88da496ef3ac9bf2a9dab101bb5827d9f41df04 Mon Sep 17 00:00:00 2001 From: Anatoli Papirovski Date: Mon, 15 Jan 2018 10:09:55 -0500 Subject: [PATCH] test: fix flaky interval test PR-URL: https://github.com/nodejs/node/pull/18161 Fixes: https://github.com/nodejs/node/issues/18160 Reviewed-By: Rich Trott Reviewed-By: Michael Dawson Reviewed-By: Luigi Pinca --- .../test-timers-set-interval-excludes-callback-duration.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test/sequential/test-timers-set-interval-excludes-callback-duration.js b/test/sequential/test-timers-set-interval-excludes-callback-duration.js index 736b0f56c5d745..d47659d7b395ab 100644 --- a/test/sequential/test-timers-set-interval-excludes-callback-duration.js +++ b/test/sequential/test-timers-set-interval-excludes-callback-duration.js @@ -8,10 +8,10 @@ let first; const t = setInterval(() => { cntr++; if (cntr === 1) { - first = Timer.now(); common.busyLoop(100); + first = Timer.now(); } else if (cntr === 2) { - assert(Timer.now() - first < 120); + assert(Timer.now() - first < 100); clearInterval(t); } }, 100);