Tests enter in pending state and not able to connect to selenium grid

1

I'm running 50 tests on parallel on Desktop browser using Nightwatch JS framework. Not all tests are starting and I keep getting error Failed to connect to Selenium Server on testgrid-devicefarm.us-west-2.amazonaws.com with port 443 After further investigation I found this also is sent out

500 POST https://testgrid-devicefarm.us-west-2.amazonaws.com/xxx=/wd/hub/session (1534ms) 
 { 
      value: { 
        error: 'session not created'
        message: 'Cannot exceed 50 concurrent sessions. Currently active=48, pending=2, failed=0'
      } 
  } 
Failed to connect to Selenium Server on testgrid-devicefarm.us-west-2.amazonaws.com with port 443

Is this problem with Nightwatch or DeviceFarm ? What makes the test enter pending state ? How does AWS Device Farm selenium grid is not handling those requests ?

Mostafa
asked 2 years ago459 views
1 Answer
0

Hello,

Tim here from Premium Support.

Great job on the description here, it really helped us understand the issue clearly; just wanted to mention that before digging in!

Based on the error it looks like you’re opening too many sessions to fast but I got some figures to share and what we can do as the next steps.

Desktop browser testing has a limit of creating 5 sessions per second and a maximum of 50 concurrent sessions.

You can stagger the creation of sessions or add a slight delay. If you have too many open sessions or create them too fast, session creation will fail.

If you do need to have 50 or more concurrent sessions, feel free to open a support case with us and mention your use case as detailed as possible. If the case submission form asks for items, then those are usually required for us to get started. As a general tip for any support case here is what really helps get things moving quick on requests:

  • Amazon resource names (ARN)
  • Timestamps
  • Detailed logs with timestamps, AWS request ids, and your timezone (Note: if you're getting logs from CloudWatch Insights it can truncate information, so I recommend inspecting CloudWatch log streams instead). If you are using the AWS SDK enabling the DEBUG level of logging can capture all of this information; here's some information on accomplishing this with Java to get an idea and our other AWS SDKs have similar mechanisms for enabling DEBUG level logging: https://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/java-dg-logging.html#sdk-net-logging-request-response
  • Links to tutorials or examples followed
  • Architecture maps (can be very simple text based or drawings, doesn’t have to be fancy)
  • Devices in use (since we're using Device Farm here)
  • SDK/CLI commands/APIs in use and their request format and returned response payload (Note: Earlier we discussed enabling DEBUG level logging with AWS SDKs, but the AWS CLI has a --debug flag you can use also!)
  • Code snippets or examples used
  • Endpoints
  • Load test results
  • Use case
  • Blockers identified
  • X-Ray traces (Tip: if using Lambda, patch the code to instrument X-Ray tracing!)
  • An explanation of the flow of requests throughout the system
  • Best practices followed or workarounds that needed to be taken
  • If any recent changes took place and if things worked prior or had ever worked
  • Software versions of tools, resources, libraries/modules/frameworks
  • Screenshots of metrics (be sure to include the timestamps in the screenshot!)
  • Having relevant teammates/engineers/colleagues/managers CC'd on the support case

Those type of items are excellent to have. Some may not be relevant for your use case, but just wanted to be sure I was as complete as I could be encase it’s ever handy for other AWS services.

You can open a support case with us at this link as the next step and hope to hear from you soon: https://aws.amazon.com/premiumsupport/knowledge-center/get-aws-technical-support/

AWS
SUPPORT ENGINEER
Tim_P
answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions