From 7cc61d7f1d05d76c5b284ef695a216da45eb880c Mon Sep 17 00:00:00 2001 From: Brendan Kenny Date: Fri, 10 Nov 2017 15:06:25 -0800 Subject: [PATCH] tests(smokehouse): add long task to byte-efficiency tester to deflake appveyor --- .../test/fixtures/byte-efficiency/tester.html | 8 +++++++- .../test/smokehouse/byte-efficiency/expectations.js | 12 +++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/lighthouse-cli/test/fixtures/byte-efficiency/tester.html b/lighthouse-cli/test/fixtures/byte-efficiency/tester.html index 3167787a13ea..d9d60a25f2dc 100644 --- a/lighthouse-cli/test/fixtures/byte-efficiency/tester.html +++ b/lighthouse-cli/test/fixtures/byte-efficiency/tester.html @@ -31,11 +31,17 @@ document.head.appendChild(style); } +// Add a long task to delay FI +setTimeout(() => { + const start = Date.now(); + while (Date.now() < start + 100) ; +}, 2000); + // Lazily load the image setTimeout(() => { const template = document.getElementById('lazily-loaded-image'); document.body.appendChild(template.content.cloneNode(true)); -}, 6000); +}, 7000);