yahoo / protractor-retry

Use protractor features to automatically re-run failed tests with a specific configurable number of attempts.
MIT License
28 stars 32 forks source link

Specs are not re-run when Chrome fails to start #25

Open khitrenovich opened 6 years ago

khitrenovich commented 6 years ago

From time to time I see that Chrome fails to start in our Jenkins server. It looks like protractor-retry does not recognize such cases as build failures and does not re-run those specs. Is there anything that can be done for those failures too?

Sample logs:

[16:45:28] I/testLogger - [chrome #01-12] PID: 18145
[chrome #01-12] Specs: /home/centos/jenkins/workspace/************/spec/integration/login/login.spec.js
[chrome #01-12] 
[chrome #01-12] [16:44:28] I/direct - Using ChromeDriver directly...
[chrome #01-12] 
[chrome #01-12] /home/centos/jenkins/workspace/************/node_modules/selenium-webdriver/lib/error.js:27
[chrome #01-12]     super(opt_error);
[chrome #01-12]     ^
[chrome #01-12] WebDriverError: unknown error: Chrome failed to start: exited abnormally
[chrome #01-12]   (Driver info: chromedriver=2.26.436382 (70eb799287ce4c2208441fc057053a5b07ceabac),platform=Linux 3.10.0-693.11.6.el7.x86_64 x86_64)
[chrome #01-12]     at WebDriverError (/home/centos/jenkins/workspace/************/node_modules/selenium-webdriver/lib/error.js:27:5)
[chrome #01-12]     at Object.checkLegacyResponse (/home/centos/jenkins/workspace/************/node_modules/selenium-webdriver/lib/error.js:639:15)
[chrome #01-12]     at parseHttpResponse (/home/centos/jenkins/workspace/************/node_modules/selenium-webdriver/http/index.js:538:13)
[chrome #01-12]     at client_.send.then.response (/home/centos/jenkins/workspace/************/node_modules/selenium-webdriver/http/index.js:472:11)
[chrome #01-12]     at ManagedPromise.invokeCallback_ (/home/centos/jenkins/workspace/************/node_modules/selenium-webdriver/lib/promise.js:1379:14)
[chrome #01-12]     at TaskQueue.execute_ (/home/centos/jenkins/workspace/************/node_modules/selenium-webdriver/lib/promise.js:2913:14)
[chrome #01-12]     at TaskQueue.executeNext_ (/home/centos/jenkins/workspace/************/node_modules/selenium-webdriver/lib/promise.js:2896:21)
[chrome #01-12]     at asyncRun (/home/centos/jenkins/workspace/************/node_modules/selenium-webdriver/lib/promise.js:2820:25)
[chrome #01-12]     at /home/centos/jenkins/workspace/************/node_modules/selenium-webdriver/lib/promise.js:639:7
[chrome #01-12]     at process._tickCallback (internal/process/next_tick.js:109:7)
[chrome #01-12] From: Task: WebDriver.createSession()
[chrome #01-12]     at Function.createSession (/home/centos/jenkins/workspace/************/node_modules/selenium-webdriver/lib/webdriver.js:329:24)
[chrome #01-12]     at Driver (/home/centos/jenkins/workspace/************/node_modules/selenium-webdriver/chrome.js:778:38)
[chrome #01-12]     at Direct.getNewDriver (/home/centos/jenkins/workspace/************/node_modules/protractor/built/driverProviders/direct.js:70:26)
[chrome #01-12]     at Runner.createBrowser (/home/centos/jenkins/workspace/************/node_modules/protractor/built/runner.js:198:43)
[chrome #01-12]     at /home/centos/jenkins/workspace/************/node_modules/protractor/built/runner.js:277:30
[chrome #01-12]     at _fulfilled (/home/centos/jenkins/workspace/************/node_modules/protractor/node_modules/q/q.js:834:54)
[chrome #01-12]     at self.promiseDispatch.done (/home/centos/jenkins/workspace/************/node_modules/protractor/node_modules/q/q.js:863:30)
[chrome #01-12]     at Promise.promise.promiseDispatch (/home/centos/jenkins/workspace/************/node_modules/protractor/node_modules/q/q.js:796:13)
[chrome #01-12]     at /home/centos/jenkins/workspace/************/node_modules/protractor/node_modules/q/q.js:556:49
[chrome #01-12]     at runSingle (/home/centos/jenkins/workspace/************/node_modules/protractor/node_modules/q/q.js:137:13)

[16:45:28] I/testLogger - 

[16:45:28] E/launcher - Runner process exited unexpectedly with error code: 1
amrot17 commented 6 years ago

Hi

the current algorithm can't detect this kind of errors as this error happened (before/during) the instance creation , and the current mechanism to detect errors is happening (at/during) the test level - instance is up and running at this point -

will do some investigation to see if we can detect this kind of errors if i got some time

Thanks for using the package and hope that its helping you so far

khitrenovich commented 6 years ago

Thank you for maintaining that, it is really helpful!

laflaneuse commented 6 years ago

I have a similar behavior in case of compilation errors for testcases. The failing testcases will not be re-run even though compilation fails.

Logs build 14-Aug-2018 09:39:51 [chrome #01-13] Specs: somefile.ts build 14-Aug-2018 09:39:51 [chrome #01-13] build 14-Aug-2018 09:39:51 [chrome #01-13] (node:165) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead. build 14-Aug-2018 09:39:51 [chrome #01-13] [07:39:41] I/hosted - Using the selenium server at http://server:port/wd/hub build 14-Aug-2018 09:39:51 [chrome #01-13] [07:39:51] I/runnerCli - ⨯ Unable to compile TypeScript: build 14-Aug-2018 09:39:51 [chrome #01-13] somefile.ts(121,69): error TS2339: Property 'property' does not exist on type 'typeHelper'. ... Would this have the same cause as mentioned above or is there a possibility curently of passing this over as an error for a retry?