From e3e492af0c9d9c99ce31b9dc036dbf75327e6f30 Mon Sep 17 00:00:00 2001 From: Alex Rodionov Date: Fri, 26 Nov 2021 08:28:06 -0800 Subject: [PATCH] Do not attempt to stop process when it's not started Fixes #10015 --- rb/lib/selenium/webdriver/common/service_manager.rb | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/rb/lib/selenium/webdriver/common/service_manager.rb b/rb/lib/selenium/webdriver/common/service_manager.rb index 7718acb33df86..874ac4e1562b1 100644 --- a/rb/lib/selenium/webdriver/common/service_manager.rb +++ b/rb/lib/selenium/webdriver/common/service_manager.rb @@ -60,6 +60,7 @@ def start def stop return unless @shutdown_supported + return if process_exited? stop_server @process.poll_for_exit STOP_TIMEOUT @@ -109,15 +110,11 @@ def start_process end def stop_process - return if process_exited? - @process.stop STOP_TIMEOUT @process.io.stdout.close if Platform.jruby? && !WebDriver.logger.debug? end def stop_server - return if process_exited? - connect_to_server do |http| headers = WebDriver::Remote::Http::Common::DEFAULT_HEADERS.dup http.get('/shutdown', headers)