Protractor: UnhandledPromiseRejectionWarning: Unhandled promise rejection selenium_server_logs.log.lck

Created on 21 Apr 2017  路  2Comments  路  Source: angular/protractor

Hi there,

I'm currently using the following configurations:

  • Node Version: v6.9.1
  • Protractor Version: 5.0.0
  • Angular Version: 1.5.11
  • Browser(s): Chrome 54.0.2840.100
  • Operating System and Version CentOS Linux release 7.2.1511 (Core)
    -selenium-server-standalone-2.53.1.jar

A sample of my protractor configuration is the following:

seleniumServerJar: './node_modules/protractor/node_modules/webdriver-manager/selenium/selenium-server-standalone-2.53.1.jar',
localSeleniumStandaloneOpts: {

  args: ['-log', './Results/selenium_server_logs.log', '-debug'],

  jvmArgs: [

            '-Dwebdriver.gecko.driver=./node_modules/protractor/node_modules/webdriver-manager/selenium/geckodriver-v0.12.0.exe',

            '-Dwebdriver.ie.driver=./node_modules/protractor/node_modules/webdriver-manager/selenium/IEDriverServer_Win32_2.53.1.exe'

        ]

},

I run a suite of tests which produce the following output:

Failures:

1) Scenario: Aca_Le_Ext_Gf01_Tc01 - Verify An Admin User With A Valid Employer Code, User Id & Password Can Log Into The ACA Website - Cucumber/Login_Epic/Aca_Le_Ext_Gf01.feature:7
Step: When These Credentials Are Inputted To A Tagged Browser Type - Cucumber/Login_Epic/Aca_Le_Ext_Gf01.feature:13
Step Definition: StepDefinitions/Common/Aca_Common_steps.js:39
Message:
AssertionError: expected false to equal true
From: Task:
at World.RunNonAngular (/home/jenkins/workspace/ACA_System_Test_Smoke_Dev/Support/CucumberJs_World.js:70:12)
at AcaModuleLoginPageExternal.WaitForSssIframeToRender (/home/jenkins/workspace/ACA_System_Test_Smoke_Dev/ModuleHelper/Aca_Module_External_Login.js:58:25)
at /home/jenkins/workspace/ACA_System_Test_Smoke_Dev/StepDefinitions/Common/Aca_Common_steps.js:72:41
at ManagedPromise.invokeCallback_ (/home/jenkins/workspace/ACA_System_Test_Smoke_Dev/node_modules/selenium-webdriver/lib/promise.js:1366:14)
at TaskQueue.execute_ (/home/jenkins/workspace/ACA_System_Test_Smoke_Dev/node_modules/selenium-webdriver/lib/promise.js:2970:14)
at TaskQueue.executeNext_ (/home/jenkins/workspace/ACA_System_Test_Smoke_Dev/node_modules/selenium-webdriver/lib/promise.js:2953:27)
at asyncRun (/home/jenkins/workspace/ACA_System_Test_Smoke_Dev/node_modules/selenium-webdriver/lib/promise.js:2813:27)
at /home/jenkins/workspace/ACA_System_Test_Smoke_Dev/node_modules/selenium-webdriver/lib/promise.js:676:7
at process._tickCallback (internal/process/next_tick.js:103:7)

2) Scenario: Aca_Le_Ext_Gf01_Tc02 - Verify An Hr User With A Valid Employer Code, User Id & Password Can Log Into The ACA Website - Cucumber/Login_Epic/Aca_Le_Ext_Gf01.feature:23
Step: Then The Browser Redirects To Page "Aca_Reports_Dashboard" - Cucumber/Login_Epic/Aca_Le_Ext_Gf01.feature:35
Step Definition: StepDefinitions/Common/Aca_Common_steps.js:120
Message:
AssertionError: expected false to equal true

3) Scenario: Aca_Ume_Ext_Gf02_Tc01 - Verify An Hr User After Successful Login Is Unable To Access The User Management Dashboard - Cucumber/User_Management_Epic/Aca_Ume_Ext_Gf02.feature:17
Step: And The Browser Redirects To Page "Aca_Reports_Dashboard" - Cucumber/User_Management_Epic/Aca_Ume_Ext_Gf02.feature:22
Step Definition: StepDefinitions/Common/Aca_Common_steps.js:120
Message:
AssertionError: expected false to equal true

19 scenarios (3 failed, 16 passed)
145 steps (3 failed, 5 skipped, 137 passed)
9m15.841s
Adding First Feature To Cucumber Test Report Object... login_epic
Adding New Features To Cucumber Test Report Object... user_management_epic
Adding Test Scenarios To Existing Feature... user_management_epic
Adding Test Scenarios To Existing Feature... user_management_epic
[13:15:10] I/local - Shutting down selenium standalone server.
[13:15:10] I/launcher - 0 instance(s) of WebDriver still running
[13:15:10] I/launcher - chrome #01 failed 3 test(s)
[13:15:10] I/launcher - overall: 3 failed spec(s)
Finished With Exit Code 1
(node:4209) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: ENOENT: no such file or directory, lstat '/home/jenkins/workspace/ACA_System_Test_Smoke_Dev/Results/selenium_server_logs.log.lck'

In this case this throws an unhandled PromiseRejectionWarning which terminates the process ungracefully. This only occurs when I specify the logging settings:

localSeleniumStandaloneOpts: {

  args: ['-log', './Results/selenium_server_logs.log', '-debug'],

},

Now this only occurs from time to time about 3 runs out of 10 and without logging this never occurs. In addition, this only occurs when I encounter a failed scenario. It is also worth noting when a scenario fails in the After hook we reset the browser using calls

browser.restart();

browser.get(browser.baseUrl);

so to get the browser back to a known state. Has anyone seen this issue occur before? Many thanks in advance & apologies if I'm posting this issue in the wrong repository location.

All 2 comments

From your logs:

Error: ENOENT: no such file or directory, lstat '/home/jenkins/workspace/ACA_System_Test_Smoke_Dev/Results/selenium_server_logs.log.lck'

It looks like this is probably due to an issue with filesystem state on your Jenkins worker and not an issue with Protractor itself. I'm not super familiar with the logging setup here (or its interactions with Jenkins) so i'd suggest following up on StackOverflow or a Jenkins specific forum.

Good luck! 馃槃

This has nothing to do with Jenkins. What you see from the logs is the location to where the log is been wrote to (which happens to be a file path location that has string 'jenkins' in it). The reason I created this bug in the protractor space is the way protractor is interacting with the selenium server jar file and how protractor is setting the logs via the command line which was something new that was added to this build I listed above.

Why are you closing this when you are not familiar with the logging setup?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

vishalshivnath picture vishalshivnath  路  3Comments

tmeneau picture tmeneau  路  3Comments

codef0rmer picture codef0rmer  路  3Comments

psech picture psech  路  3Comments

smarts picture smarts  路  3Comments