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

Modify shutdown order #59

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Commits on May 26, 2022

  1. Modify shutdown order

    puppeteer v14.1.1 on macOS 12.4 M1 Pro
    
    Saw the error below when calling `fakeBrowser.shutdown()`, caused by the puppeteer’s `BrowserRunner` code trying to kill the process group when FakeBrowser had already killed all its PIDs.
    
    This commit changes the order to call `browser.close()` _before_ killing the process tree. You may also choose to simply remove the process killing code since [puppeteer already does that](https://github.com/puppeteer/puppeteer/blob/256223a7b18672ae3890bde312986482ea0fed52/src/node/BrowserRunner.ts#L182-L220).
    
    ```
    Unhandled Rejection at: Promise {
      <rejected> Error: Puppeteer was unable to kill the process which ran the browser binary.
      This means that, on future Puppeteer launches, Puppeteer might not be able to launch the browser.
      Please check your open processes and ensure that the browser processes that Puppeteer launched have been killed.
      If you think this is a bug, please report it on the Puppeteer issue tracker.
      Error cause: Error: kill EPERM
          at process.kill (node:internal/process/per_thread:220:13)
          at BrowserRunner.kill (<removed>/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:196:29)
          at <removed>/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:168:22
          at processTicksAndRejections (node:internal/process/task_queues:96:5)
          at BrowserRunner.kill (<removed>/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:200:23)
          at <removed>/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:168:22
          at processTicksAndRejections (node:internal/process/task_queues:96:5)
    }
    ```
    davecardwell committed May 26, 2022
    Configuration menu
    Copy the full SHA
    edd4e2b View commit details
    Browse the repository at this point in the history
  2. Fix helper => this.

    Co-authored-by: BEAR <[email protected]>
    davecardwell and RubtsovAV committed May 26, 2022
    Configuration menu
    Copy the full SHA
    2196026 View commit details
    Browse the repository at this point in the history