sauce sessions check

This commit is contained in:
yevh-berdnyk 2022-04-01 07:44:31 +03:00
parent c9441b2db7
commit cde0abd238
No known key found for this signature in database
GPG Key ID: 0642C73C66214825
1 changed files with 7 additions and 0 deletions

View File

@ -6,8 +6,15 @@ import json
from support.appium_container import AppiumContainer from support.appium_container import AppiumContainer
from support.test_data import TestSuiteData from support.test_data import TestSuiteData
import time
async def start_threads(quantity: int, func: type, returns: dict, *args): async def start_threads(quantity: int, func: type, returns: dict, *args):
loop = asyncio.get_event_loop() loop = asyncio.get_event_loop()
from tests.conftest import sauce
for _ in range(10):
if 16 - len([job for job in sauce.jobs.get_jobs() if job['status'] == 'in progress']) < quantity:
time.sleep(10)
for i in range(quantity): for i in range(quantity):
returns[i] = loop.run_in_executor(None, func, *args) returns[i] = loop.run_in_executor(None, func, *args)
for k in returns: for k in returns: