Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tests(smoke): add long task to byte-efficiency tester to deflake appveyor #3804

Merged
merged 1 commit into from
Nov 13, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion lighthouse-cli/test/fixtures/byte-efficiency/tester.html
Original file line number Diff line number Diff line change
Expand Up @@ -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);
</script>
<style>
.onscreen {
Expand Down
12 changes: 9 additions & 3 deletions lighthouse-cli/test/smokehouse/byte-efficiency/expectations.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,15 @@ module.exports = [
score: '<100',
extendedInfo: {
value: {
results: {
length: 3,
},
results: [
{
url: /lighthouse-unoptimized.jpg$/,
}, {
url: /lighthouse-480x320.webp$/,
}, {
url: /large.svg$/,
},
],
},
},
},
Expand Down