Skip to content

Webdriver hangs for ~1 minute even if chromedriver exits immediately #349

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

Closed
tullmann opened this issue Mar 19, 2015 · 1 comment
Closed
Assignees

Comments

@tullmann
Copy link
Contributor

This isn't a direct problem with webdriver, but it does make diagnosing other problems harder. I had a bug in my chromedriver wrapper script, and it was exiting immediately. But webdriver will hang for a minute before reporting a problem, and will just report a timeout, not that the chromedriver failed/exited.

I believe the core of the problem is in javascript/node/selenium-webdriver/remote/index.js where the command.result().then handler will not kick the httpUtil.waitForServer in the case the command exits early/immediately.

The patch below demonstrates the problem by adding a test for using /bin/false as the chromedriver. It times out after a minute.

diff --git a/javascript/node/selenium-webdriver/test/chrome/options_test.js b/javascript/node/selenium-webdriver/test/chrome/options_test.js
index eab3070..39524b9 100644
--- a/javascript/node/selenium-webdriver/test/chrome/options_test.js
+++ b/javascript/node/selenium-webdriver/test/chrome/options_test.js
@@ -204,7 +204,7 @@ test.suite(function(env) {
     driver.quit();
   });

-  describe('Chrome options', function() {
+  describe.only('Chrome options', function() {
     test.it('can start Chrome with custom args', function() {
       var options = new chrome.Options().
           addArguments('user-agent=foo;bar');
@@ -219,5 +219,16 @@ test.suite(function(env) {
           'return window.navigator.userAgent');
       assert(userAgent).equalTo('foo;bar');
     });
+
+    test.it('can catch bad startup script', function() {
+      var options = new chrome.Options().
+        setChromeBinaryPath('/bin/false');
+
+      driver = env.builder().
+          setChromeOptions(options).
+          build();
+
+      driver.get('nothing');
+    });
   });
 }, {browsers: ['chrome']});
@jleyba jleyba self-assigned this Mar 19, 2015
@jleyba jleyba closed this as completed in dc18923 Mar 19, 2015
@tullmann
Copy link
Contributor Author

Thanks for the quick fix!

@lock lock bot locked and limited conversation to collaborators Aug 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants