From 8b8be7bed4184be684ff1a729fe90ba350a10da2 Mon Sep 17 00:00:00 2001 From: John Spray Date: Wed, 25 Oct 2023 13:29:30 +0100 Subject: [PATCH] tests: don't fail tests on torn log lines (#5655) ## Problem Tests that force-kill and restart a service can generate torn log lines that might match WARN|ERROR, but not match the allow expression that a test has loaded, e.g. https://neon-github-public-dev.s3.amazonaws.com/reports/pr-5651/6638398772/index.html#suites/7538959189f4501983ddd9e167836c8b/d272ba8a73e6945c ## Summary of changes Ignore log lines which match a regex for torn log lines on restart: they have two timestamps and the second line is an "INFO version"... message. --- test_runner/fixtures/neon_fixtures.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/test_runner/fixtures/neon_fixtures.py b/test_runner/fixtures/neon_fixtures.py index 38e17985ac..1a7db18b07 100644 --- a/test_runner/fixtures/neon_fixtures.py +++ b/test_runner/fixtures/neon_fixtures.py @@ -1719,6 +1719,11 @@ class NeonPageserver(PgProtocol): break if error_or_warn.search(line): + # Is this a torn log line? This happens when force-killing a process and restarting + # Example: "2023-10-25T09:38:31.752314Z WARN deletion executo2023-10-25T09:38:31.875947Z INFO version: git-env:0f9452f76e8ccdfc88291bccb3f53e3016f40192" + if re.match("\\d{4}-\\d{2}-\\d{2}T.+\\d{4}-\\d{2}-\\d{2}T.+INFO version.+", line): + continue + # It's an ERROR or WARN. Is it in the allow-list? for a in self.allowed_errors: if re.match(a, line):