From 94f7907b554db5949b15b8a014c3b528a7b0d357 Mon Sep 17 00:00:00 2001 From: Robin Malfait Date: Thu, 25 Jun 2026 19:23:36 +0200 Subject: [PATCH] add margin of error to the test Sometimes this is flaky on CI, even though it doesn't make any sense because we use `setTimeout(_, 500)` which should _at least_ result in 500ms... But sometimes this results into: ``` AssertionError: expected 499.76 to be greater than or equal to 500 ``` --- packages/@tailwindcss-node/src/instrumentation.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/@tailwindcss-node/src/instrumentation.test.ts b/packages/@tailwindcss-node/src/instrumentation.test.ts index b2068d9d6..102c7ed8e 100644 --- a/packages/@tailwindcss-node/src/instrumentation.test.ts +++ b/packages/@tailwindcss-node/src/instrumentation.test.ts @@ -83,7 +83,7 @@ it('should measure async callbacks via the `span` api', async () => { `) let [, duration] = stripVTControlCharacters(output).match(/\[(.*)\]/)! - expect(parseFloat(duration)).toBeGreaterThanOrEqual(500) + expect(parseFloat(duration)).toBeGreaterThanOrEqual(500 - 2 /* Margin of error */) }) })