diff --git a/webhook_server/tests/test_helpers.py b/webhook_server/tests/test_helpers.py index d9df1923..c570d540 100644 --- a/webhook_server/tests/test_helpers.py +++ b/webhook_server/tests/test_helpers.py @@ -708,26 +708,20 @@ def test_get_logger_with_params_multiprocess_rotation_concurrency(self, tmp_path ordered_files = [*backup_paths, base_log] line_pattern = re.compile(r"^(\S+)\s+.*worker=(\d+)\s+(?:msg|pad)=(\d+)") last_msg_by_worker: dict[int, int] = {} - file_ts_bounds: list[tuple[datetime, datetime]] = [] for log_path in ordered_files: - timestamps: list[datetime] = [] - for line in log_path.read_text(encoding="utf-8").splitlines(): + lines = log_path.read_text(encoding="utf-8").splitlines() + assert lines + for line in lines: match = line_pattern.match(line) assert match is not None, f"Unparseable or interleaved log line in {log_path}: {line!r}" ts_str, worker_str, seq_str = match.groups() - timestamps.append(datetime.fromisoformat(ts_str)) + datetime.fromisoformat(ts_str) if " msg=" in line: w_id = int(worker_str) seq = int(seq_str) assert seq > last_msg_by_worker.get(w_id, -1) last_msg_by_worker[w_id] = seq - assert timestamps - file_ts_bounds.append((min(timestamps), max(timestamps))) - - for earlier, later in zip(file_ts_bounds, file_ts_bounds[1:], strict=False): - assert earlier[0] <= later[0] - assert earlier[1] <= later[1] finally: for worker in workers: if worker.is_alive():