From 4c0c47fb0be9cba692bb2f641cb8b61d150837ae Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Tue, 23 Jun 2026 12:25:04 +0200 Subject: test/stress: prettier log output --- test/stress/test.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'test/stress/test.py') 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__": -- cgit v1.3