-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Chromelauncher error on when killing instance #2337
Comments
I've been seeing this too when using headless Chrome. We need to investigate. Until then, the workaround is what you're doing...introduce a small delay before killing chrome. See also #1931 (comment). |
Thanks for the test case, we will get to the bottom of this. |
Confirmed this is 100% reproducible on headless but not on normal chrome. const lighthouse = require('lighthouse');
import {launch} from './chrome-launcher';
async function runLighthouse(url: string) {
const opts = {
chromeFlags: ['--headless'],
};
const chrome = await launch(opts);
const flags = {
output: 'json',
port: chrome.port,
};
const results = await lighthouse(url, flags);
process.on('uncaughtException', (e: any) => {
console.log(e);
});
await chrome.kill();
return results;
}
runLighthouse('https://example.com'); |
It is possible that we were resolving the gather chain before we had disconnected. When manually launching and killing chrome this can race and result in an error to the user. This fixes that problem. \o/. Fixes #2337 --- Test plan: Run launcher with: ```ts const lighthouse = require('lighthouse'); import {launch} from './chrome-launcher'; async function runLighthouse(url: string) { const opts = { chromeFlags: ['--headless'], }; const chrome = await launch(opts); const flags = { output: 'json', port: chrome.port, }; const results = await lighthouse(url, flags); process.on('uncaughtException', (e: any) => { console.log(e); }); await chrome.kill(); return results; } runLighthouse('https://example.com'); ``` Without this patch, and then run it with the patch. Observe it now working.
Circling back. |
ack, the root of this bug was in lighthouse, headless just made it happen more 🗡 |
Is this actually fixed? I'm launching headless chrome with chrome launcher v0.3.2 and running into this issue. Should I instead be using lighthouse and importing the chrome-launcher module? |
I've been trying to get headless chrome running, but I've been getting
Error: read ECONNRESET
which I've been able to reproduce consistently here:Node versions used: 6.8.0 & 7.9.0
Lighthouse: 2.0.0
OS: Mac OS Sierra 10.12.4 & Ubuntu LTS 14.04 (Travis)
I've been able to fix this by either catching the
process.on('uncaughtException', ...
event inchrome-launcher.js
, or setting a timeout on theawait chrome.kill();
code. Neither of which I believe is ideal since I'm quite new to Node.The text was updated successfully, but these errors were encountered: