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

[rb] Handle graceful webdriver shutdown #14430

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

Commits on Aug 23, 2024

  1. [rb] Handle graceful webdriver shutdown

    When shutting down `Selenium::WebDriver::ServiceManager#stop_server`
    issues a `/shutdown` request against the webdriver server and the
    server exits cleanly, however the mechanism to assert if the child
    process is up or not cannot distinguish between busy or not found.
    
    `Selenium::WebDriver::ChildProcess#exited?` returns `false` when the
    process is still alive because
    `Selenium::WebDriver::ChildProcess#waitpid2` returns `nil`.
    
    However, by catching `Errno::ECHILD` and `Errno::ESRCH` and returning
    `nil` `#waitpid2` masks a not running pid as "running" delaying the
    shutdown procedure when the server was already gone.
    
    This patch moves the exception handling away from the `Process` wrappers
    so its closer to the decision points in
    `Selenium::WebDriver::ChildProcess#exited?` and
    `Selenium::WebDriver::ChildProcess#stop`.
    
    Addresses a similar inconsistency in SeleniumHQ#14032
    josegomezr committed Aug 23, 2024
    Configuration menu
    Copy the full SHA
    4217e3c View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    3236c31 View commit details
    Browse the repository at this point in the history