Skip to content

Commit c398bb4

Browse files
committed
add rertries for flakyness
1 parent 4a3bbb2 commit c398bb4

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

tests/integ/test_pytorch_local_cpu.py

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
import pytest
22
from transformers.testing_utils import require_torch
3+
import tenacity
34

45
from tests.integ.helpers import verify_task
56

67

78
class TestPytorchLocal:
8-
9+
@tenacity.retry(
10+
stop=tenacity.stop_after_attempt(5),
11+
reraise=True,
12+
)
913
@require_torch
1014
@pytest.mark.parametrize(
1115
"task",
@@ -43,6 +47,10 @@ def test_pt_container_local_model(
4347

4448
verify_task(task=task, port=local_container[1])
4549

50+
@tenacity.retry(
51+
stop=tenacity.stop_after_attempt(5),
52+
reraise=True,
53+
)
4654
@require_torch
4755
@pytest.mark.parametrize(
4856
"repository_id",
@@ -61,6 +69,10 @@ def test_pt_container_custom_handler(
6169
port=local_container[1],
6270
)
6371

72+
@tenacity.retry(
73+
stop=tenacity.stop_after_attempt(5),
74+
reraise=True,
75+
)
6476
@require_torch
6577
@pytest.mark.parametrize(
6678
"repository_id",

0 commit comments

Comments
 (0)