public inbox for [email protected]
help / color / mirror / Atom feedFrom: Yogesh Mahajan <[email protected]>
To: pgadmin-hackers <[email protected]>
Subject: Feature Test Fix
Date: Tue, 13 Apr 2021 19:35:35 +0530
Message-ID: <CAMa=N=MAzQqxWtHQeYFnYx9Lz0XRrY-UV5Q3ZS66dCCic0fWHw@mail.gmail.com> (raw)
Hi,
Please find the attached patch which handles the long time taken to launch
pgAdmin in debug mode.
Feature tests were failing as pgAdmin was tried to reach before it
completed initialization.Currently if pgAdmin is launched with Debug=True,
then on jenkins job its taking 70+ seconds for completing initialisation.
Thanks,
Yogesh Mahajan
EnterpriseDB
Attachments:
[application/octet-stream] FeatureTestsFix_longTimeToload_v1.patch (3.4K, 3-FeatureTestsFix_longTimeToload_v1.patch)
download | inline diff:
diff --git a/web/regression/python_test_utils/test_utils.py b/web/regression/python_test_utils/test_utils.py
index 91bdb0d..4de3ad9 100644
--- a/web/regression/python_test_utils/test_utils.py
+++ b/web/regression/python_test_utils/test_utils.py
@@ -1332,8 +1332,9 @@ def launch_url_in_browser(driver_instance, url, title='pgAdmin 4', timeout=50):
if count == 0:
print(str(e))
exception_msg = 'Web-page title did not match to {0}. ' \
- 'Please check url {1} accessible on ' \
- 'internet.'.format(title, url)
+ 'Waited for {1} seconds Please check url {2}' \
+ ' accessible on internet.'.\
+ format(title, timeout, url)
raise WebDriverException(exception_msg)
diff --git a/web/regression/runtests.py b/web/regression/runtests.py
index f039e58..1142fb9 100644
--- a/web/regression/runtests.py
+++ b/web/regression/runtests.py
@@ -570,12 +570,12 @@ def run_parallel_tests(url_client, servers_details, parallel_tests_lists,
:param max_thread_count:
"""
driver_object = None
- try:
- # Thread list
- threads_list = []
- # Create thread for each server
- for ser in servers_details:
- # Logic to add new threads
+
+ # Thread list
+ threads_list = []
+ # Create thread for each server
+ for ser in servers_details:
+ try:
while True:
# If active thread count <= max_thread_count, add new thread
if threading.activeCount() <= max_thread_count:
@@ -603,16 +603,24 @@ def run_parallel_tests(url_client, servers_details, parallel_tests_lists,
else:
time.sleep(10)
- # Start threads in parallel
- for t in threads_list:
- t.join()
- except Exception as exc:
- # Print exception stack trace
- traceback.print_exc(file=sys.stderr)
- print(str(exc))
- # Clean driver object created
- if driver_object is not None:
- driver_object.quit()
+ # Start threads in parallel
+ for t in threads_list:
+ t.join()
+
+ except Exception as exc:
+ # Print exception stack trace
+ traceback.print_exc(file=sys.stderr)
+ 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
+ if driver_object is not None:
+ driver_object.quit()
def run_sequential_tests(url_client, servers_details, sequential_tests_lists,
@@ -816,6 +824,12 @@ if __name__ == '__main__':
app_starter_local = AppStarter(None, config)
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
if len(parallel_tests) > 0:
parallel_sessions = \
view thread (8+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected]
Subject: Re: Feature Test Fix
In-Reply-To: <CAMa=N=MAzQqxWtHQeYFnYx9Lz0XRrY-UV5Q3ZS66dCCic0fWHw@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox