From 9e3dc473bc16080fac90598b81b33e0074a3ac49 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20K=C3=B6ssler?= Date: Wed, 18 Dec 2024 16:55:54 +0100 Subject: [PATCH 1/2] Fix flaky performance test Performance in GitHub Actions is not predictable --- library/helpers/ip-matcher/performance.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/helpers/ip-matcher/performance.test.ts b/library/helpers/ip-matcher/performance.test.ts index 17940ee3..16922c1d 100644 --- a/library/helpers/ip-matcher/performance.test.ts +++ b/library/helpers/ip-matcher/performance.test.ts @@ -810,6 +810,6 @@ t.test("test performance in comparison to node:net.blocklist", async (t) => { const percentageDiff = ((blockListMs - ipMatcherMs) / ipMatcherMs) * 100; - // Expect the IPMatcher to be at least 100% faster than the BlockList - t.same(percentageDiff > 100, true); + // Expect the IPMatcher to be faster than the BlockList + t.same(percentageDiff > 0, true); }); From 097769d453b63dfb9bc7cc213544f3a7cc07aee9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20K=C3=B6ssler?= Date: Wed, 18 Dec 2024 17:11:20 +0100 Subject: [PATCH 2/2] Increase to 25% --- library/helpers/ip-matcher/performance.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/helpers/ip-matcher/performance.test.ts b/library/helpers/ip-matcher/performance.test.ts index 16922c1d..558b29b1 100644 --- a/library/helpers/ip-matcher/performance.test.ts +++ b/library/helpers/ip-matcher/performance.test.ts @@ -811,5 +811,5 @@ t.test("test performance in comparison to node:net.blocklist", async (t) => { const percentageDiff = ((blockListMs - ipMatcherMs) / ipMatcherMs) * 100; // Expect the IPMatcher to be faster than the BlockList - t.same(percentageDiff > 0, true); + t.same(percentageDiff > 25, true); });