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

fix: add delay in between multiple audits #79

Merged
merged 20 commits into from
Jan 28, 2023
Merged
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
99f407c
test: try to reproduce issue 109 in GitHub Action
adamhenson Jan 28, 2023
735fc79
test: try to reproduce issue 109 in GitHub Action
adamhenson Jan 28, 2023
0663ce8
test: try to reproduce issue 109 in GitHub Action
adamhenson Jan 28, 2023
fa41005
test: try to reproduce issue 109 in GitHub Action
adamhenson Jan 28, 2023
bf14ad2
test: try to reproduce issue 109 in GitHub Action
adamhenson Jan 28, 2023
aa1461e
test: try to reproduce issue 109 in GitHub Action
adamhenson Jan 28, 2023
21b97c3
test: try to reproduce issue 109 in GitHub Action
adamhenson Jan 28, 2023
dad7ab4
test: try to reproduce issue 109 in GitHub Action
adamhenson Jan 28, 2023
8c64f13
test: try to reproduce issue 109 in GitHub Action
adamhenson Jan 28, 2023
b5b0b50
test: try to reproduce issue 109 in GitHub Action
adamhenson Jan 28, 2023
23e87a1
test: try to reproduce issue 109 in GitHub Action
adamhenson Jan 28, 2023
b8274c0
test: try to reproduce issue 109 in GitHub Action
adamhenson Jan 28, 2023
dadd7e9
test: try to reproduce issue 109 in GitHub Action
adamhenson Jan 28, 2023
6189771
chore: bump lightouse-persist
adamhenson Jan 28, 2023
06f3760
chore: bump lightouse-persist
adamhenson Jan 28, 2023
c6e7522
fix: delay runs when multiple to give previous Chrome process time to…
adamhenson Jan 28, 2023
385b7ab
fix: delay runs when multiple to give previous Chrome process time to…
adamhenson Jan 28, 2023
85b4b54
fix: remove verbose logs
adamhenson Jan 28, 2023
060a136
chore: remove test assets
adamhenson Jan 28, 2023
e93e815
chore: remove vulnerabilities
adamhenson Jan 28, 2023
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
26 changes: 13 additions & 13 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -49,7 +49,7 @@
"*.{js,css,md}": "prettier --write"
},
"dependencies": {
"@foo-software/lighthouse-persist": "^6.2.0",
"@foo-software/lighthouse-persist": "^6.3.1",
"@slack/webhook": "^6.1.0",
"babel-jest": "^29.3.1",
"lodash.get": "^4.4.2",
2 changes: 2 additions & 0 deletions src/helpers/utils.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export const delay = (timeout) =>
new Promise((resolve) => setTimeout(resolve, timeout));
5 changes: 5 additions & 0 deletions src/localLighthouse.js
Original file line number Diff line number Diff line change
@@ -2,6 +2,7 @@ import lighthousePersist from '@foo-software/lighthouse-persist';
import fs from 'fs';
import get from 'lodash.get';
import { NAME } from './constants';
import { delay } from './helpers/utils';
import writeResults from './helpers/writeResults';
import { desktop, mobile, throttling } from './lighthouseConfig';
import options from './lighthouseOptions';
@@ -249,6 +250,10 @@ export default async ({
`${NAME}: Auditing ${auditConfig.emulatedFormFactor} (${index}/${auditConfigs.length}): ${auditConfig.url}`,
);
}

// 1 second delay to allow time of previous Chrome process end
await delay(1000);

const lighthouseAuditResult = await getLocalLighthouseResultsWithRetries({
auditConfig,
maxRetries,