playwright-perl icon indicating copy to clipboard operation
playwright-perl copied to clipboard

Shutdown of playwright_server failing during global destruction

Open kcaran opened this issue 1 year ago • 5 comments
trafficstars

When I run tests on my macbook (perl 5.36), I get the following error at the end of the program:

(in cleanup) Can't call method "request" on an undefined value at /usr/local/lib/perl5/site_perl/5.36.1/Playwright/Util.pm line 39 during global destruction.

I've confirmed that the LWP::UserAgent object used by the Playwright handle is being destroyed before the Playwright object itself.

Creating a new LWP::UserAgent object inside of Playwright::quit() before (or inside) the call to Playwright::Util::request() fixes the issue, but I'm not sure that is the cleanest way to solve it. But it doesn't look like there is an easy way to guarantee object destruction order.

kcaran avatar Aug 07 '24 15:08 kcaran