From d7b98c53a160cc1bd6a9bd6387db4a98da61b9d7 Mon Sep 17 00:00:00 2001 From: Mark Molinaro Date: Wed, 17 Nov 2021 12:12:45 -0800 Subject: [PATCH] test: fix instability in polling tests --- test/helpers/TestHelper.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/helpers/TestHelper.js b/test/helpers/TestHelper.js index 02214ce..e548122 100644 --- a/test/helpers/TestHelper.js +++ b/test/helpers/TestHelper.js @@ -119,9 +119,11 @@ TestHelper.prototype.remove = function remove(name) { }; TestHelper.prototype.tick = function tick(arg, fn) { + // if polling is set, ensure the tick is longer than the polling interval. + let defaultTick = (+process.env.WATCHPACK_POLLING || 100) + 10; if (typeof arg === "function") { fn = arg; - arg = 100; + arg = defaultTick; } setTimeout(function() { fn();