BrowserStack Automate Parallel Session Limits and Queue Behavior for a Small Test Suite
0 reputation · 19 Mar 2021, 06:52 UTC
0 reputation · 19 Mar 2021, 06:52 UTC
BrowserStack Automate runs Selenium WebDriver and Appium tests in parallel, but the number of concurrent sessions is capped by the subscription plan rather than by the suite itself. For a small application with a compact test suite, the goal is to size parallel runs correctly: how many sessions the plan allows, what happens to tests submitted beyond that cap, and whether queued jobs wait in a predictable order or fail.
Two constraints make this hard to plan in advance. Concurrency allowances are plan-specific and can change with pricing updates, so an assumed capacity may not match the current account. Device and browser availability is also dynamic, since a requested device may be in use or unavailable in a region, so queue times can vary between runs. Automate and Live also serve different purposes, scripted versus manual interactive testing, so capacity assumptions should not mix the two products.
What behavior should be expected when submitted tests exceed the parallel session cap, and where can the current allowance be confirmed? Is there a documented way to handle a busy or unavailable device, such as falling back to an alternative, while keeping results comparable across runs?
In BrowserStack Automate, the number of concurrent tests is governed strictly by your subscription plan's concurrency limit, regardless of the size of your test suite. When the number of submitted tests exceeds this cap, BrowserStack employs a First-In, First-Out (FIFO) queue. Excess jobs do not fail immediately; instead, they wait in a queue until an active session completes and a slot becomes available.
Because concurrency limits are tied to account billing and can vary by plan, you should verify your current capacity directly in the platform rather than assuming a fixed number:
While the session cap manages overall volume, specific device or browser availability is dynamic. A requested device may be unavailable due to high regional demand or current usage by another user on your account, leading to variable queue times.
To prevent tests from hanging or failing due to a specific unavailable device, you can implement a programmatic fallback in your test runner. Since there is no native "auto-fallback" toggle in the capabilities, use the following logic:
try-catch block.catch block, update your DesiredCapabilities to a secondary, comparable device (e.g., switching from an iPhone 15 Pro to an iPhone 14).Switching devices can introduce environmental variables. To ensure results remain comparable, you must log the actual device used for the run. Use the BrowserStack session API or custom test logs to record the Session ID and the Actual Device Name. This allows you to distinguish between a functional bug and a device-specific rendering issue during analysis.
Diagnostic Note: To provide a more specific fallback recommendation, please clarify if you are using a specific test orchestrator (e.g., Pytest, TestNG, or JUnit) that handles retries at the framework level.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.