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 disconnect promise race. #2359

Merged
merged 1 commit into from
May 25, 2017
Merged

😈 Fix disconnect promise race. #2359

merged 1 commit into from
May 25, 2017

Commits on May 25, 2017

  1. 😈 Fix disconnect promise race.

    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.
    samccone committed May 25, 2017
    Configuration menu
    Copy the full SHA
    da24004 View commit details
    Browse the repository at this point in the history