mirror of
https://github.com/pgadmin-org/pgadmin4.git
synced 2025-02-25 18:55:31 -06:00
Fixed an issue where a long time is taken to launch pgAdmin in debug mode for feature tests.
This commit is contained in:
parent
f07463024c
commit
4ee40e348c
@ -1332,8 +1332,9 @@ def launch_url_in_browser(driver_instance, url, title='pgAdmin 4', timeout=50):
|
|||||||
if count == 0:
|
if count == 0:
|
||||||
print(str(e))
|
print(str(e))
|
||||||
exception_msg = 'Web-page title did not match to {0}. ' \
|
exception_msg = 'Web-page title did not match to {0}. ' \
|
||||||
'Please check url {1} accessible on ' \
|
'Waited for {1} seconds Please check url {2}' \
|
||||||
'internet.'.format(title, url)
|
' accessible on internet.'.\
|
||||||
|
format(title, timeout, url)
|
||||||
raise WebDriverException(exception_msg)
|
raise WebDriverException(exception_msg)
|
||||||
|
|
||||||
|
|
||||||
|
@ -570,12 +570,12 @@ def run_parallel_tests(url_client, servers_details, parallel_tests_lists,
|
|||||||
:param max_thread_count:
|
:param max_thread_count:
|
||||||
"""
|
"""
|
||||||
driver_object = None
|
driver_object = None
|
||||||
try:
|
|
||||||
# Thread list
|
# Thread list
|
||||||
threads_list = []
|
threads_list = []
|
||||||
# Create thread for each server
|
# Create thread for each server
|
||||||
for ser in servers_details:
|
for ser in servers_details:
|
||||||
# Logic to add new threads
|
try:
|
||||||
while True:
|
while True:
|
||||||
# If active thread count <= max_thread_count, add new thread
|
# If active thread count <= max_thread_count, add new thread
|
||||||
if threading.activeCount() <= max_thread_count:
|
if threading.activeCount() <= max_thread_count:
|
||||||
@ -606,10 +606,18 @@ def run_parallel_tests(url_client, servers_details, parallel_tests_lists,
|
|||||||
# Start threads in parallel
|
# Start threads in parallel
|
||||||
for t in threads_list:
|
for t in threads_list:
|
||||||
t.join()
|
t.join()
|
||||||
|
|
||||||
except Exception as exc:
|
except Exception as exc:
|
||||||
# Print exception stack trace
|
# Print exception stack trace
|
||||||
traceback.print_exc(file=sys.stderr)
|
traceback.print_exc(file=sys.stderr)
|
||||||
print(str(exc))
|
print('Exception before starting tests for ' + ser['name'],
|
||||||
|
file=sys.stderr)
|
||||||
|
print(str(exc), file=sys.stderr)
|
||||||
|
|
||||||
|
# Mark failure as true
|
||||||
|
global failure
|
||||||
|
failure = True
|
||||||
|
|
||||||
# Clean driver object created
|
# Clean driver object created
|
||||||
if driver_object is not None:
|
if driver_object is not None:
|
||||||
driver_object.quit()
|
driver_object.quit()
|
||||||
@ -816,6 +824,12 @@ if __name__ == '__main__':
|
|||||||
app_starter_local = AppStarter(None, config)
|
app_starter_local = AppStarter(None, config)
|
||||||
client_url = app_starter_local.start_app()
|
client_url = app_starter_local.start_app()
|
||||||
|
|
||||||
|
if config.DEBUG:
|
||||||
|
print('pgAdmin is launched with DEBUG=True, '
|
||||||
|
'hence sleeping for 50 seconds.',
|
||||||
|
file=sys.stderr)
|
||||||
|
time.sleep(50)
|
||||||
|
|
||||||
# Running Parallel tests
|
# Running Parallel tests
|
||||||
if len(parallel_tests) > 0:
|
if len(parallel_tests) > 0:
|
||||||
parallel_sessions = \
|
parallel_sessions = \
|
||||||
|
Loading…
Reference in New Issue
Block a user