Skip to content

Commit eeb04e7

Browse files
authored
Add pytest flaky-retry mechanism for handling intermittent test failures (#2151)
1 parent 3ab77f7 commit eeb04e7

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

.github/workflows/build-wheels.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ jobs:
121121
- uses: actions/checkout@v4
122122

123123
- name: Install test dependencies
124-
run: pip install pytest hypothesis psutil pyarrow
124+
run: pip install pytest pytest-retry hypothesis psutil pyarrow
125125

126126
- name: Run tests
127127
shell: bash

pyproject.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ doc = [
5252
]
5353
test = [
5454
"pytest",
55+
"pytest-retry",
5556
"hypothesis",
5657
"psutil",
5758
"pyarrow",
@@ -112,6 +113,7 @@ select = ["NPY201"]
112113
[tool.cibuildwheel]
113114
test-requires = [
114115
"pytest",
116+
"pytest-retry",
115117
"hypothesis",
116118
"psutil",
117119
"pyarrow",

tiledb/tests/test_dask.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44

55
import numpy as np
66
import pytest
7+
from distributed.comm.core import CommClosedError
8+
from tornado.iostream import StreamClosedError
79

810
import tiledb
911

@@ -42,6 +44,9 @@ def _make_multiattr_2d(self, uri, shape=(0, 100), tile=10):
4244

4345
tiledb.DenseArray.create(uri, schema)
4446

47+
@pytest.mark.flaky(
48+
reruns=3, reruns_delay=2, only_rerun=(CommClosedError, StreamClosedError)
49+
)
4550
@pytest.mark.filterwarnings("ignore:There is no current event loop")
4651
def test_dask_multiattr_2d(self):
4752
uri = self.path("multiattr")

0 commit comments

Comments
 (0)