From: Otto Date: Wed, 10 Nov 2021 12:56:26 +0000 (+0100) Subject: print stderr and stdout for api test X-Git-Tag: dnsdist-1.7.0-beta1~7^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F10973%2Fhead;p=thirdparty%2Fpdns.git print stderr and stdout for api test --- diff --git a/.github/workflows/build-and-test-all.yml b/.github/workflows/build-and-test-all.yml index 513c456a1f..46bf0d36a4 100644 --- a/.github/workflows/build-and-test-all.yml +++ b/.github/workflows/build-and-test-all.yml @@ -333,7 +333,7 @@ jobs: sanitizers: [ubsan+asan] threads: [1, 2, 3, 4, 8, 16] mthreads: [2048, 4096] - shards: [1, 2, 1028] + shards: [1, 2, 1024] env: UBSAN_OPTIONS: 'print_stacktrace=1:halt_on_error=1:suppressions=/home/runner/work/pdns/pdns/build-scripts/UBSan.supp' ASAN_OPTIONS: detect_leaks=0 diff --git a/regression-tests.api/runtests.py b/regression-tests.api/runtests.py index 3c2463d5c3..ad25fe13fe 100755 --- a/regression-tests.api/runtests.py +++ b/regression-tests.api/runtests.py @@ -226,11 +226,11 @@ else: # Now run pdns and the tests. print("Launching server...") print(format_call_args(servercmd)) -serverproc = subprocess.Popen(servercmd, close_fds=True) +serverproc = subprocess.Popen(servercmd, close_fds=True, text=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE) print("Waiting for webserver port to become available...") available = False -time.sleep(0.5) +time.sleep(1) for try_number in range(0, 10): try: res = requests.get('http://127.0.0.1:%s/' % WEBPORT) @@ -240,12 +240,16 @@ for try_number in range(0, 10): print(f'HTTP error occurred: {http_err}') except Exception as err: print(f'Other error occurred: {err}') - time.sleep(0.5) + time.sleep(1) if not available: print("Webserver port not reachable after 10 tries, giving up.") serverproc.terminate() serverproc.wait() + print("==STDOUT===") + print(proc.stdout.read()) + print("==STDERRR===") + print(proc.stderr.read()) sys.exit(2) print("Query for example.com/A to create statistic data...") @@ -284,5 +288,9 @@ finally: raw_input() serverproc.terminate() serverproc.wait() + print("==STDOUT===") + print(serverproc.stdout.read()) + print("==STDERRR===") + print(serverproc.stderr.read()) sys.exit(returncode)