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

Weird stuff - Grunt process being killed due to two subsequent done-calls #26

Open
RonaldTreur opened this issue Oct 21, 2015 · 0 comments

Comments

@RonaldTreur
Copy link

So today I reinstalled grunt-protractor-webdriver and I immediately ran into a very weird problem: Grunt is being shut down prematurely. I'm not 100% sure as to what causes this, but it seems to have to do with the asynchronous nature of this plugin. Especially with the fact that the done-callback is sometimes executed twice.

Or more precisely, that happens all the time (over here).

So I tracked it down to this line:

REGEXP_START_READY = /(Started org\.openqa\.jetty\.jetty\.Server)|(Selenium Server is up and running)/

Whenever that Webdriver outputs a line that matches this regexp, a function startup is being executed. This function then invokes the done-function it obtained via Grunt's [task.]async.

Below is my WebDriver output, which shows this regexp is triggered twice. How? Because the line Started Selenium server: xxxxxxx is printed whenever startup is being executed.

Starting Selenium server
>> seleniumProcess.pid: 1529
>> 20:39:04.511 INFO - Launching a standalone Selenium Server
>> Setting system property webdriver.chrome.driver to /Users/apple/Development/VFPComponents/node_modules/protractor/selenium/chromedriver
>> 20:39:04.556 INFO - Java: Oracle Corporation 25.5-b02
>> 20:39:04.556 INFO - OS: Mac OS X 10.10.5 x86_64
>> 20:39:04.565 INFO - v2.47.1, with Core v2.47.1. Built from revision 411b314
>> 20:39:04.635 INFO - Driver provider org.openqa.selenium.ie.InternetExplorerDriver registration is skipped:
>> registration capabilities Capabilities [{ensureCleanSession=true, browserName=internet explorer, version=, platform=WINDOWS}] does not match the current platform MAC
>> 20:39:04.635 INFO - Driver provider org.openqa.selenium.edge.EdgeDriver registration is skipped:
>> registration capabilities Capabilities [{browserName=MicrosoftEdge, version=, platform=WINDOWS}] does not match the current platform MAC
>> 20:39:04.636 INFO - Driver class not found: com.opera.core.systems.OperaDriver
>> 20:39:04.636 INFO - Driver provider com.opera.core.systems.OperaDriver is not registered
>> 20:39:04.679 INFO - Version Jetty/5.1.x
>> 20:39:04.680 INFO - Started HttpContext[/selenium-server,/selenium-server]
>> 20:39:04.704 INFO - Started org.openqa.jetty.jetty.servlet.ServletHandler@7d417077
>> 20:39:04.704 INFO - Started HttpContext[/wd,/wd]
>> 20:39:04.704 INFO - Started HttpContext[/selenium-server/driver,/selenium-server/driver]
>> 20:39:04.704 INFO - Started HttpContext[/,/]
>> 20:39:04.708 INFO - Started SocketListener on 0.0.0.0:4444

>> 20:39:04.708 INFO - Started org.openqa.jetty.jetty.Server@46f7f36a
Started Selenium server: http://localhost:4444

>> 20:39:04.709 INFO - RemoteWebDriver instances should connect to: http://127.0.0.1:4444/wd/hub

>> 20:39:04.709 INFO - Selenium Server is up and running
Started Selenium server: http://127.0.0.1:4444

Solution?

If I simply change the regexp to:

REGEXP_START_READY = /(Selenium Server is up and running)/

everything runs just fine. Grunt is not killed before its time and all subsequent tasks (like watch) possess the power to keep Grunt running forever.

I'm guessing this particular regexp might have something to do with supporting multiple Webdriver versions (I'm using version 2.47.0 btw), but I guess this can easily be prevented, by making sure only one startup-call (or done-call) is allowed?

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