Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions tests/utils/tracked_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,9 +143,13 @@ def run_and_wait(
self.remove()

# To see the reason, we run assert statements separately
assert no_failure == rc_success
assert no_warnings == (not self.get_warnings(logs))
assert no_errors == (not self.get_errors(logs))
assert (
no_failure == rc_success
), f"Container exited with code {rv['StatusCode']}"
warnings = self.get_warnings(logs)
assert no_warnings == (not warnings), f"Warnings found: {warnings}"
errors = self.get_errors(logs)
assert no_errors == (not errors), f"Errors found: {errors}"

if split_stderr:
return (stdout, stderr)
Expand All @@ -158,7 +162,14 @@ def get_errors(logs: str) -> list[str]:

@staticmethod
def get_warnings(logs: str) -> list[str]:
return TrackedContainer._lines_starting_with(logs, "WARNING")
warnings = TrackedContainer._lines_starting_with(logs, "WARNING")
warnings = [
line
for line in warnings
if "WARNING: All log messages before absl::InitializeLog() is called are written to STDERR"
not in line
]
return warnings

@staticmethod
def _lines_starting_with(logs: str, pattern: LiteralString) -> list[str]:
Expand Down