From 2a44203d96cc8c09f597e6f7ddf34dc8a13e58e7 Mon Sep 17 00:00:00 2001 From: Tim van der Meij Date: Sat, 6 Jul 2024 16:17:36 +0200 Subject: [PATCH] Fix the "caches image resources at the document/page level as expected (issue 11878)" unit test This unit test fails occasionally (albeit much less than before thanks to PR #17663), so we change the parsing time check's divisor to prevent it from happening again. If the last page's rendering time is less than or equal to 50% of the first page's rendering time that should be enough proof that no worker thread re-parsing occurred while also providing a wide enough range to avoid intermittents. Note that the assertion is now equal to the one we already have in the "caches image resources at the document/page level, with main-thread copying of complex images (issue 11518)" unit test which seems to work reliably so far. --- test/unit/api_spec.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/unit/api_spec.js b/test/unit/api_spec.js index 44f9de06b9373..7a383498c3a9c 100644 --- a/test/unit/api_spec.js +++ b/test/unit/api_spec.js @@ -4155,7 +4155,7 @@ Caron Broadcasting, Inc., an Ohio corporation (“Lessee”).`) checkedCopyLocalImage = true; // Ensure that the image was copied in the main-thread, rather // than being re-parsed in the worker-thread (which is slower). - expect(statsOverall).toBeLessThan(firstStatsOverall / 4); + expect(statsOverall).toBeLessThan(firstStatsOverall / 2); } } }