File size: 935 Bytes
2415c4c
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# SPDX-FileCopyrightText: © 2026 Tenstorrent AI ULC
# SPDX-License-Identifier: Apache-2.0

import pytest

from models.common.tests.conftest import _is_device_fatal_error


class PcieHangError(Exception):
    pass


@pytest.mark.parametrize(
    "exc",
    [
        RuntimeError("Read 0xffffffff over PCIe ID 13: the board should be reset."),
        PcieHangError("Read 0xffffffff over PCIe ID 0: the board should be reset."),
        RuntimeError("UMD_THROW PcieHangError"),
    ],
)
def test_device_fatal_hang_signatures(exc):
    assert _is_device_fatal_error(exc)


@pytest.mark.parametrize(
    "exc",
    [
        RuntimeError("No TT devices detected on this system"),
        RuntimeError("Unable to query TT devices on this system"),
        RuntimeError("mesh_shape is required"),
        ValueError("unsupported mesh"),
    ],
)
def test_benign_device_errors_are_not_fatal(exc):
    assert not _is_device_fatal_error(exc)