diff options
| author | Egor Tensin <egor@tensin.name> | 2026-06-23 12:25:04 +0200 |
|---|---|---|
| committer | Egor Tensin <egor@tensin.name> | 2026-06-23 15:06:44 +0200 |
| commit | 4c0c47fb0be9cba692bb2f641cb8b61d150837ae (patch) | |
| tree | c5f91faac5c041b4f584e232029aa972ba1d177c /test | |
| parent | upgrade cmake-common (diff) | |
| download | math-server-4c0c47fb0be9cba692bb2f641cb8b61d150837ae.tar.gz math-server-4c0c47fb0be9cba692bb2f641cb8b61d150837ae.zip | |
test/stress: prettier log output
Diffstat (limited to '')
| -rwxr-xr-x | test/stress/test.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/test/stress/test.py b/test/stress/test.py index 8b82961..4f40b15 100755 --- a/test/stress/test.py +++ b/test/stress/test.py @@ -151,7 +151,7 @@ class Output: def _run_client(client, stdin): - with _logging(): + with _setup_logging(): cmd = client.get_command_line() with timer("Client invocation"): result = subprocess.run( @@ -256,24 +256,24 @@ def _parse_args(argv=None): @contextmanager -def _logging(): +def _setup_logging(): logging.basicConfig( - format="%(asctime)s | %(levelname)s | %(message)s", - datefmt="%Y-%m-%d %H:%M:%S%z", level=logging.DEBUG, + datefmt="%Y-%m-%d %H:%M:%S%z", + # The 8 below is for "CRITICAL" + format="%(asctime)s | %(levelname)8s | %(message)s", ) try: yield except Exception as e: logging.exception(e) - raise + sys.exit(1) def main(argv=None): - with _logging(): - args = _parse_args(argv) - if not _run_stress_test(args): - sys.exit(1) + args = _parse_args(argv) + with _setup_logging(): + sys.exit(0 if _run_stress_test(args) else 1) if __name__ == "__main__": |
