Files
third_party_mesa3d/.gitlab-ci/lava/utils/lava_log_hints.py
Guilherme Gallo bfd50f72eb ci/lava: Turn the r8152 issue check into a counter
We were just detecting if a log like
[  143.080663] r8152 2-1.3:1.0 eth0: Tx status -71
happened once before
[  316.389695] nfs: server 192.168.201.1 not responding, still trying

But we can use a counter to be more assured that the device is
struggling to recover and we can add let this detection happen during
the boot phase.

This mimics how other freedreno devices deal with this problem, see
`cros_servo_run.py:64` for example.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27081>
2024-01-16 17:22:04 +00:00

46 lines
1.6 KiB
Python

from __future__ import annotations
import re
from dataclasses import dataclass, field
from typing import TYPE_CHECKING, Any
if TYPE_CHECKING:
from lava.utils import LogFollower
from lava.exceptions import MesaCIKnownIssueException
from lava.utils.console_format import CONSOLE_LOG
from lava.utils.constants import KNOWN_ISSUE_R8152_MAX_CONSECUTIVE_COUNTER
from lava.utils.log_section import LogSectionType
@dataclass
class LAVALogHints:
log_follower: LogFollower
r8152_issue_consecutive_counter: int = field(default=0, init=False)
def detect_failure(self, new_lines: list[dict[str, Any]]):
for line in new_lines:
self.detect_r8152_issue(line)
def detect_r8152_issue(self, line):
if (
self.log_follower.phase == LogSectionType.TEST_CASE and line["lvl"] == "target"
):
if re.search(r"r8152 \S+ eth0: Tx status -71", line["msg"]):
self.r8152_issue_consecutive_counter += 1
return
if self.r8152_issue_consecutive_counter >= KNOWN_ISSUE_R8152_MAX_CONSECUTIVE_COUNTER:
if re.search(
r"nfs: server \d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3} not responding, still trying",
line["msg"],
):
raise MesaCIKnownIssueException(
f"{CONSOLE_LOG['FG_MAGENTA']}"
"Probable network issue failure encountered, retrying the job"
f"{CONSOLE_LOG['RESET']}"
)
# Reset the status, as the `nfs... still trying` complaint was not detected
self.r8152_issue_consecutive_counter = 0