From 94b4d3cc780a03dba3547e0ee6c4cf9c7849ce95 Mon Sep 17 00:00:00 2001 From: John Spray Date: Thu, 16 May 2024 10:07:03 +0100 Subject: [PATCH] tests: make pgbench parsing work with pg14 --- .../performance/test_sharding_autosplit.py | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/test_runner/performance/test_sharding_autosplit.py b/test_runner/performance/test_sharding_autosplit.py index 8f9a7124e9..5eeac35471 100644 --- a/test_runner/performance/test_sharding_autosplit.py +++ b/test_runner/performance/test_sharding_autosplit.py @@ -107,13 +107,20 @@ def test_sharding_autosplit(neon_env_builder: NeonEnvBuilder, pg_bin: PgBin): for line in stderr.split("\n"): match = re.match(r"progress: ([0-9\.]+) s, ([0-9\.]+) tps, .* ([0-9]+) failed", line) if match is None: - continue + # Fall back to older-version pgbench output (omits failure count) + match = re.match(r"progress: ([0-9\.]+) s, ([0-9\.]+) tps, .*", line) + if match is None: + continue + else: + (_time, tps) = match.groups() + tps = float(tps) + failed = 0 else: - matched_lines += 1 + (_time, tps, failed) = match.groups() # type: ignore + tps = float(tps) + failed = int(failed) - (_time, tps, failed) = match.groups() - tps = float(tps) - failed = int(failed) + matched_lines += 1 if failed > 0: raise RuntimeError(