Skip to content

Commit 2c40681

Browse files
committed
test(nvidia_smi): add xfail for crash group 3616
Captures the non-XML inputs that hit parse_nvidia_smi today: "No devices were found" (Linux, SUP-28831) and the Windows "nvidia-smi.exe was not found in:" error block (crash group 3616). Both trigger xml.etree.ElementTree.ParseError. Marked xfail(strict=True); the marker is removed by the fix commit. Crash-Group-ID: 3616 Jira: SUP-28831 AI-Generated: true Change-Id: I6895baae5c9816d6e151ef3bedb7e099cb906917
1 parent 91542d7 commit 2c40681

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

tests/unit/cmk/plugins/nvidia/agent_based/test_nvidia_smi.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,33 @@ def test_parse_nvidia_smi(
289289
assert nvidia_smi.parse_nvidia_smi(string_table) == expected_result
290290

291291

292+
# Inputs captured verbatim from real agents that emit non-XML on the nvidia_smi
293+
# section. They must be tolerated, not crash the parser with xml.etree.ParseError.
294+
# * linux_no_devices: SUP-28831 — RHEL host with installed nvidia-smi but no
295+
# visible GPU returns "No devices were found".
296+
# * windows_nvidia_smi_missing: crash group 3616 — Windows agent plugin emits
297+
# a "not found in:" error block when nvidia-smi.exe is absent.
298+
@pytest.mark.xfail(strict=True, reason="Crash group 3616: ParseError on non-XML nvidia-smi output")
299+
@pytest.mark.parametrize(
300+
"string_table",
301+
[
302+
pytest.param([["No devices were found"]], id="linux_no_devices"),
303+
pytest.param(
304+
[
305+
["ERROR: nvidia-smi.exe was not found in:"],
306+
["- (configured path)"],
307+
["- C:\\Program Files\\NVIDIA Corporation\\NVSMI\\nvidia-smi.exe (default path)"],
308+
["- system PATH"],
309+
],
310+
id="windows_nvidia_smi_missing",
311+
),
312+
],
313+
)
314+
def test_parse_nvidia_smi_non_xml_output(string_table: StringTable) -> None:
315+
section = nvidia_smi.parse_nvidia_smi(string_table)
316+
assert section.gpus == {}
317+
318+
292319
@pytest.mark.parametrize(
293320
"section, expected_result",
294321
[

0 commit comments

Comments
 (0)