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

Ports seem to stay open when session is closed #43

Closed
dbrody opened this issue Oct 7, 2022 · 1 comment
Closed

Ports seem to stay open when session is closed #43

dbrody opened this issue Oct 7, 2022 · 1 comment

Comments

@dbrody
Copy link
Contributor

dbrody commented Oct 7, 2022

When opening browser via Playwright.BrowserType.launch(:chromium, options) and then closing the browser via Playwright.Browser.close(), the port opened to run chromium seems to stay open.

Seems to stem from within Playwright.Transport when called with Transport.Driver here:
https://github.com/geometerio/playwright-elixir/blob/17abee407e2d5fa30cc42ce62e8017c3d0ae8680/lib/playwright/transport/driver.ex#L18-L22

Even though all the GenServers are started with start_link it doesnt seem to clean up the port.

@dbrody
Copy link
Contributor Author

dbrody commented Oct 7, 2022

When closing the browser, playwright elixir keeps the GenServer of the Session alive.

In order to close the session and close the port you must close the session_pid like such:

# Start Browser
{_, browser} = Playwright.BrowserType.launch(:chromium, options)


# Close Browser and Port
DynamicSupervisor.terminate_child(Playwright.Channel.Session.Supervisor, browser.session)

@dbrody dbrody closed this as completed Oct 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant