Skip to content

Commit

Permalink
Remove multiline param for panic patterns and add more info in panic msg
Browse files Browse the repository at this point in the history
  • Loading branch information
lubaihua33 committed Dec 9, 2024
1 parent ec1a0c8 commit 7fbc8c5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
10 changes: 5 additions & 5 deletions lisa/features/serial_console.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,12 @@

class SerialConsole(Feature):
panic_patterns: List[Pattern[str]] = [
re.compile(r"^(.*Kernel panic - not syncing:.*)$", re.MULTILINE),
re.compile(r"^(.*RIP:.*)$", re.MULTILINE),
re.compile(r"^(.*grub>.*)$", re.MULTILINE),
re.compile(r"^The operating system has halted.$", re.MULTILINE),
re.compile(r"^(.*Kernel panic - not syncing:.*)$"),
re.compile(r"^(.*RIP:.*)$"),
re.compile(r"^(.*grub>.*)$"),
re.compile(r"^The operating system has halted.$"),
# Synchronous Exception at 0x000000003FD04000
re.compile(r"^(.*Synchronous Exception at.*)$", re.MULTILINE),
re.compile(r"^(.*Synchronous Exception at.*)$"),
]

# ignore some return lines, which shouldn't be a panic line.
Expand Down
17 changes: 11 additions & 6 deletions lisa/util/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,12 @@


PANIC_PATTERNS: List[Pattern[str]] = [
re.compile(r"^(.*Kernel panic - not syncing:.*)$", re.MULTILINE),
re.compile(r"^(.*RIP:.*)$", re.MULTILINE),
re.compile(r"^(.*grub>.*)$", re.MULTILINE),
re.compile(r"^The operating system has halted.$", re.MULTILINE),
re.compile(r"^(.*Kernel panic - not syncing:.*)$"),
re.compile(r"^(.*RIP:.*)$"),
re.compile(r"^(.*grub>.*)$"),
re.compile(r"^The operating system has halted.$"),
# Synchronous Exception at 0x000000003FD04000
re.compile(r"^(.*Synchronous Exception at.*)$", re.MULTILINE),
re.compile(r"^(.*Synchronous Exception at.*)$"),
]

# ignore some return lines, which shouldn't be a panic line.
Expand Down Expand Up @@ -328,7 +328,12 @@ def __init__(
self.source = source

def __str__(self) -> str:
return f"{self.stage} found panic in {self.source}: {self.panics}"
return (
f"{self.stage} found panic in {self.source}. You can check the panic "
"details from the serial console log. Please download the test logs and "
"retrieve the serial_log from 'environments' directory, or you can ask "
"support. Detected Panic phrases: {self.panics}"
)


class RequireUserPasswordException(LisaException):
Expand Down

0 comments on commit 7fbc8c5

Please sign in to comment.