Closed doteric closed 6 months ago
"--headless='new'"
- Not 100% sure if this is the problem, but this seems to be the new headless mode that puppeteer is testing. Could you try --headless=true
and see if the browser can close without hanging (with your code that closes all the pages before closing the browser)?
Thanks @JacksonGL for the idea 💪
Sadly --headless=true
+ closing all pages before closing the browser does not seem to fix the issue with browser.close()
hanging.
For now I will introduce a bypass to waiting for browser.close()
to finish, but of course it's far from ideal so if you have any other ideas what could be wrong then I would highly appreciate it 🙇
Hello @JacksonGL
I assume you haven't looked into this problem?
Would you be okey for me to create a PR that contains an option to disable waiting for the browser to close? What do you think of that? Or maybe you have some other better approach on the back of your head?
Thank you
@doteric Feel free to create a PR, I am happy to review it
@JacksonGL
MR created https://github.com/facebook/memlab/pull/120/files
Please let me know if it's correct
@doteric I left a comment on the PR.
@doteric Please check and accept the CLA agreement so I can import and integrate your PR.
https://github.com/facebook/memlab/blob/main/CONTRIBUTING.md#contributor-license-agreement-cla
Closing this as the PR is released in memlab@1.1.48
.
Hello 👋
I have been having a problem running MemLab in an AWS Lambda (NodeJS v18) timing out no matter what time it is given and decided to investigate what's wrong. After a bit of investigation trying with and wihtout the warmup it looked like MemLab does all the needed work, but just fails to finish off and end, looked into it further and it seems to be an exact same problem that I had somewhere else with puppeteer. https://github.com/Sparticuz/chromium/issues/85#issuecomment-1549894734
The issue was that the browser can not close properly for some reason, but when all the pages are closed beforehand then it closes all fine. However this is not the case in this situation and I am still experiencing the
browser.close()
hanging even with the following code of MemLab:Any other ideas what could be wrong?
To add to this I could not use the defined
pages
as the passed array is[page]
(insidetestInBrowser
) and does not include any other pages (not expected, but possible) therefore it is safer to just look for all the pages again withawait browser.pages()
Puppeteer chromium flags just FYI if they would matter by any chance (one part from MemLab, other part from
@sparticuz/chromium
.