diff options
author | algobolson <45948765+algobolson@users.noreply.github.com> | 2020-03-31 08:27:57 -0400 |
---|---|---|
committer | Tsachi Herman <tsachi@algorand.com> | 2020-05-01 20:54:36 -0400 |
commit | d9badc17ff5bfd48845a7b5c99f227f18daa7b9d (patch) | |
tree | 8caf6515c091d4fae701d5f6699d006401109578 | |
parent | 78d7b0b50cae807af16416a175ac1e7b169282c2 (diff) |
e2e_basic_start_stop debugging (#937)v2.0.6-stable
wait at least 5s for algod shutdown. better subtest logging
-rwxr-xr-x | test/scripts/e2e_basic_start_stop.sh | 4 | ||||
-rwxr-xr-x | test/scripts/e2e_client_runner.py | 33 |
2 files changed, 19 insertions, 18 deletions
diff --git a/test/scripts/e2e_basic_start_stop.sh b/test/scripts/e2e_basic_start_stop.sh index 21d4897c9..3f519e037 100755 --- a/test/scripts/e2e_basic_start_stop.sh +++ b/test/scripts/e2e_basic_start_stop.sh @@ -24,13 +24,13 @@ function verify_at_least_one_running() { } function verify_none_running() { - # Shutting down can take some time, so retry up to 2 seconds + # Shutting down can take some time, so wait at least 5 seconds for TRIES in 1 2 3 4 5; do update_running_count if [ ${RUNNING_COUNT} -eq 0 ]; then return 0 fi - sleep .4 + sleep 1.4 done echo "algod not expected to be running but it is" exit 1 diff --git a/test/scripts/e2e_client_runner.py b/test/scripts/e2e_client_runner.py index aef12cfe3..b5c6d10ea 100755 --- a/test/scripts/e2e_client_runner.py +++ b/test/scripts/e2e_client_runner.py @@ -109,22 +109,23 @@ def _script_thread_inner(runset, scriptname): retcode = -1 dt = time.time() - start if retcode != 0: - logger.error('%s failed in %f seconds', scriptname, dt) - st = os.stat(cmdlogpath) - with open(cmdlogpath, 'r') as fin: - if st.st_size > LOG_WHOLE_CUTOFF: - fin.seek(st.st_size - LOG_WHOLE_CUTOFF) - text = fin.read() - lines = text.splitlines() - if len(lines) > 1: - # drop probably-partial first line - lines = lines[1:] - sys.stderr.write('end of log follows:\n') - sys.stderr.write('\n'.join(lines)) - sys.stderr.write('\n\n') - else: - sys.stderr.write('whole log follows:\n') - sys.stderr.write(fin.read()) + with runset.lock: + logger.error('%s failed in %f seconds', scriptname, dt) + st = os.stat(cmdlogpath) + with open(cmdlogpath, 'r') as fin: + if st.st_size > LOG_WHOLE_CUTOFF: + fin.seek(st.st_size - LOG_WHOLE_CUTOFF) + text = fin.read() + lines = text.splitlines() + if len(lines) > 1: + # drop probably-partial first line + lines = lines[1:] + sys.stderr.write('end of log follows ({}):\n'.format(scriptname)) + sys.stderr.write('\n'.join(lines)) + sys.stderr.write('\n\n') + else: + sys.stderr.write('whole log follows ({}):\n'.format(scriptname)) + sys.stderr.write(fin.read()) else: logger.info('finished %s OK in %f seconds', scriptname, dt) runset.done(scriptname, retcode == 0, dt) |