An issue that you might encounter while testing Sauce Labs on the public cloud is that a real device might not be available (this may also happen to your private devices). In our European and US data centers we have numerous devices that are available for all users to use and when you schedule a test to use a particular device, there is a small chance that they are all in use. So what happens then?
Use case:
If you were running automation tests and required 4 iPhone 8's for example, there's a chance that you might not get all of them and this means that you would encounter something called queueing. There's a chance that you will also encounter this if you do not have the concurrency within your account. For example, you start 10 test cases but only have the concurrency to run 5. Note: Sauce Labs does not recommend intentional queueing.
In the event that this does happen your test will wait for up to a maximum of 15 minutes until a device is available AND concurrency is available.
When you kick off a new test, the immediate status you will see in the UI is queueing and then it will move into running.
A good tip to avoid this is to consider using dynamic device allocation.
caps = {
'appium:deviceName': 'iPhone.*',
};
Not intentionally queueing tests and staying within your concurrency. If you are not sure what your concurrency is you can check it here.
What might it look like?
From the UI:
You'll see just a device icon but no allocation, if you click into this test you should see that there is this banner:
Or you might find that the test suite "hangs" until devices are available:
[0-8] 2023-02-01T15:35:08.601Z WARN webdriver: Request failed with status 500
due to errorId: 5829fc27-9882-43a9-aee3-9b6bbf782852 -
Unable to allocate device within 900000ms or 3 tries.
This can happen if there were no available devices within the time or your plan's
max concurrent test run is not corresponding to your usage.
This is also the error message that you might run into when doing this. Please note this was with wdio where 90000ms is the timeout and this can be increased but not exceed OUR timeout of 15 minutes, see here.
sessionCreationTimeout is a capability that can be used to modify the Sauce Labs device allocation timeout. It has a max value of 900000ms (15 minutes) so it can only be decreased if you don't wish to wait for 15 minutes for device availability.
Another example of the capabilities.
This also happens with virtual devices, you can read about this here.