forked from SeleniumHQ/selenium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[rb] Handle graceful webdriver shutdown (SeleniumHQ#14430)
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
- Loading branch information
1 parent
a620204
commit ddb5ce9
Showing
2 changed files
with
21 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters