Skip to content
This repository has been archived by the owner on Jul 29, 2024. It is now read-only.

UnhandledPromiseRejectionWarning: Unhandled promise rejection selenium_server_logs.log.lck #4241

Closed
bhreinb opened this issue Apr 21, 2017 · 2 comments

Comments

@bhreinb
Copy link

bhreinb commented Apr 21, 2017

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: �[1mAca_Le_Ext_Gf01_Tc01 - Verify An Admin User With A Valid Employer Code, User Id & Password Can Log Into The ACA Website�[22m - �[90mCucumber/Login_Epic/Aca_Le_Ext_Gf01.feature:7�[39m
    Step: �[1mWhen These Credentials Are Inputted To A Tagged Browser Type�[22m - �[90mCucumber/Login_Epic/Aca_Le_Ext_Gf01.feature:13�[39m
    Step Definition: �[90mStepDefinitions/Common/Aca_Common_steps.js:39�[39m
    Message:
    �[31mAssertionError: 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)�[39m

  2. Scenario: �[1mAca_Le_Ext_Gf01_Tc02 - Verify An Hr User With A Valid Employer Code, User Id & Password Can Log Into The ACA Website�[22m - �[90mCucumber/Login_Epic/Aca_Le_Ext_Gf01.feature:23�[39m
    Step: �[1mThen The Browser Redirects To Page "Aca_Reports_Dashboard"�[22m - �[90mCucumber/Login_Epic/Aca_Le_Ext_Gf01.feature:35�[39m
    Step Definition: �[90mStepDefinitions/Common/Aca_Common_steps.js:120�[39m
    Message:
    �[31mAssertionError: expected false to equal true�[39m

  3. Scenario: �[1mAca_Ume_Ext_Gf02_Tc01 - Verify An Hr User After Successful Login Is Unable To Access The User Management Dashboard�[22m - �[90mCucumber/User_Management_Epic/Aca_Ume_Ext_Gf02.feature:17�[39m
    Step: �[1mAnd The Browser Redirects To Page "Aca_Reports_Dashboard"�[22m - �[90mCucumber/User_Management_Epic/Aca_Ume_Ext_Gf02.feature:22�[39m
    Step Definition: �[90mStepDefinitions/Common/Aca_Common_steps.js:120�[39m
    Message:
    �[31mAssertionError: expected false to equal true�[39m

19 scenarios (�[31m3 failed�[39m, �[32m16 passed�[39m)
145 steps (�[31m3 failed�[39m, �[36m5 skipped�[39m, �[32m137 passed�[39m)
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 #1 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.

@NickTomlin
Copy link
Contributor

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! 😄

@bhreinb
Copy link
Author

bhreinb commented Apr 24, 2017

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?

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