From 201985d673f6ff3e6c6d1769d30a64976f2d2cda Mon Sep 17 00:00:00 2001 From: "Joshua A. Horton" Date: Wed, 19 Jul 2023 08:30:11 +0700 Subject: [PATCH] chore(web): also pulls up the timeoutPromise unit-test fix --- common/web/utils/src/test/timeoutPromise.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/common/web/utils/src/test/timeoutPromise.js b/common/web/utils/src/test/timeoutPromise.js index aa8a252720..6acd6ad5b1 100644 --- a/common/web/utils/src/test/timeoutPromise.js +++ b/common/web/utils/src/test/timeoutPromise.js @@ -14,6 +14,7 @@ describe("TimeoutPromise", () => { assert.isTrue(await promise.corePromise); const end = Date.now(); + // https://github.com/nodejs/node/issues/26578 - setTimeout() may resolve 1ms early than requested. assert.isAtLeast(end-start, INTERVAL); }); @@ -59,7 +60,8 @@ describe("TimeoutPromise", () => { const end = Date.now(); assert.isAtMost(end-start, INTERVAL-1); // completes early - assert.isAtLeast(end-start, INTERVAL/2); // but not TOO early + // https://github.com/nodejs/node/issues/26578 - setTimeout() may resolve 1ms early than requested. + assert.isAtLeast(end-start, INTERVAL/2-1); // but not TOO early }); it('late dual fulfillment does not change first result', async () => { @@ -69,6 +71,7 @@ describe("TimeoutPromise", () => { assert.isTrue(await promise.corePromise); const end = Date.now(); + // https://github.com/nodejs/node/issues/26578 - setTimeout() may resolve 1ms early than requested. assert.isAtLeast(end-start, INTERVAL); promise.resolve(false);