diff options
author | Oliver Reiche <oliver.reiche@huawei.com> | 2023-03-10 13:45:11 +0100 |
---|---|---|
committer | Oliver Reiche <oliver.reiche@huawei.com> | 2023-03-13 17:28:59 +0100 |
commit | fafbd62e63dac7c08514b9ffa5e8776666759afb (patch) | |
tree | 39736476f1eb1a96a05cf765fc7535a3be4d3cc7 /test/utils/remote_execution/test_runner.py | |
parent | 9abfd2b14bbaa7cdd4711f56f70f941109e62e54 (diff) | |
download | justbuild-fafbd62e63dac7c08514b9ffa5e8776666759afb.tar.gz |
Remote Tests: Dump server output to file
... instead of using pipes that are prone to get full. Also
increase log level to Trace.
Diffstat (limited to 'test/utils/remote_execution/test_runner.py')
-rwxr-xr-x | test/utils/remote_execution/test_runner.py | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/test/utils/remote_execution/test_runner.py b/test/utils/remote_execution/test_runner.py index b77125be..c54acd3f 100755 --- a/test/utils/remote_execution/test_runner.py +++ b/test/utils/remote_execution/test_runner.py @@ -23,8 +23,6 @@ time_stop = 0 result = "UNKNOWN" stderr = "" stdout = "" -remotestdout = "" -remotestderr = "" def dump_results(): @@ -38,10 +36,6 @@ def dump_results(): f.write("%s\n" % (stdout, )) with open("stderr", "w") as f: f.write("%s\n" % (stderr, )) - with open("remotestdout", "w") as f: - f.write("%s\n" % (remotestdout, )) - with open("remotestderr", "w") as f: - f.write("%s\n" % (remotestderr, )) dump_results() @@ -58,11 +52,15 @@ os.makedirs(REMOTE_DIR, exist_ok=True) REMOTE_INFO = os.path.join(REMOTE_DIR, "info.json") REMOTE_LBR = os.path.join(REMOTE_DIR, "build-root") +if os.path.exists(REMOTE_INFO): + print(f"Warning: removing unexpected info file {REMOTE_INFO}") + os.remove(REMOTE_INFO) + remote_cmd = [ "./just", "execute", "--info-file", REMOTE_INFO, "--local-build-root", REMOTE_LBR, - "--log-limit", "5", "--plain-log", + "--log-limit", "6", "--plain-log", ] with open("compatible-remote.json") as f: @@ -71,10 +69,12 @@ with open("compatible-remote.json") as f: if compatible: remote_cmd.append("--compatible") +remotestdout = open("remotestdout", "w") +remotestderr = open("remotestderr", "w") remote_proc = subprocess.Popen( remote_cmd, - stdout=subprocess.PIPE, - stderr=subprocess.PIPE, + stdout=remotestdout, + stderr=remotestderr, ) while not os.path.exists(REMOTE_INFO): @@ -118,8 +118,6 @@ stdout = ret.stdout.decode("utf-8") stderr = ret.stderr.decode("utf-8") remote_proc.terminate() rout, rerr = remote_proc.communicate() -remotestdout = rout.decode("utf-8") -remotestderr = rerr.decode("utf-8") dump_results() |