mirror of
https://github.com/status-im/status-mobile.git
synced 2025-01-27 08:55:39 +00:00
e2e: added attempts for MaxRetryError handling
This commit is contained in:
parent
e5e68e0e83
commit
fc52d5f062
@ -1,13 +1,15 @@
|
|||||||
import asyncio
|
import asyncio
|
||||||
import logging
|
import functools
|
||||||
from datetime import datetime
|
|
||||||
import os
|
|
||||||
import json
|
import json
|
||||||
|
import logging
|
||||||
|
import os
|
||||||
|
import time
|
||||||
|
from datetime import datetime
|
||||||
|
|
||||||
|
from urllib3.exceptions import MaxRetryError
|
||||||
|
|
||||||
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 functools
|
|
||||||
|
|
||||||
import time
|
|
||||||
|
|
||||||
|
|
||||||
async def start_threads(quantity: int, func: type, returns: dict, *args):
|
async def start_threads(quantity: int, func: type, returns: dict, *args):
|
||||||
@ -19,7 +21,13 @@ async def start_threads(quantity: int, func: type, returns: dict, *args):
|
|||||||
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:
|
||||||
|
for _ in range(3):
|
||||||
|
try:
|
||||||
returns[k] = await returns[k]
|
returns[k] = await returns[k]
|
||||||
|
break
|
||||||
|
except MaxRetryError:
|
||||||
|
print("MaxRetryError when creating a driver")
|
||||||
|
time.sleep(10)
|
||||||
return returns
|
return returns
|
||||||
|
|
||||||
|
|
||||||
@ -44,6 +52,7 @@ def get_current_time():
|
|||||||
def debug(text: str):
|
def debug(text: str):
|
||||||
logging.debug(text)
|
logging.debug(text)
|
||||||
|
|
||||||
|
|
||||||
appium_root_project_path = os.path.join(os.sep.join(__file__.split(os.sep)[:-1]), '../')
|
appium_root_project_path = os.path.join(os.sep.join(__file__.split(os.sep)[:-1]), '../')
|
||||||
|
|
||||||
pytest_config_global = dict()
|
pytest_config_global = dict()
|
||||||
@ -77,6 +86,5 @@ test_dapp_name = 'simpledapp.status.im'
|
|||||||
|
|
||||||
emojis = {'thumbs-up': 2, 'thumbs-down': 3, 'love': 1, 'laugh': 4, 'angry': 6, 'sad': 5}
|
emojis = {'thumbs-up': 2, 'thumbs-down': 3, 'love': 1, 'laugh': 4, 'angry': 6, 'sad': 5}
|
||||||
|
|
||||||
|
|
||||||
with open(os.sep.join(__file__.split(os.sep)[:-1]) + '/../../../translations/en.json') as json_file:
|
with open(os.sep.join(__file__.split(os.sep)[:-1]) + '/../../../translations/en.json') as json_file:
|
||||||
transl = json.load(json_file)
|
transl = json.load(json_file)
|
||||||
|
@ -307,9 +307,11 @@ def create_shared_drivers(quantity):
|
|||||||
for i in range(quantity):
|
for i in range(quantity):
|
||||||
test_suite_data.current_test.testruns[-1].jobs[drivers[i].session_id] = i + 1
|
test_suite_data.current_test.testruns[-1].jobs[drivers[i].session_id] = i + 1
|
||||||
drivers[i].implicitly_wait(implicit_wait)
|
drivers[i].implicitly_wait(implicit_wait)
|
||||||
|
if len(drivers) < quantity:
|
||||||
|
test_suite_data.current_test.testruns[-1].error = "Not all %s drivers are created" % quantity
|
||||||
return drivers, loop
|
return drivers, loop
|
||||||
except MaxRetryError as e:
|
except MaxRetryError as e:
|
||||||
test_suite_data.current_test.testruns[-1].error = e.reason
|
test_suite_data.current_test.testruns[-1].error += "%s" % e.reason
|
||||||
raise e
|
raise e
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user