Skip to content

Commit feeb399

Browse files
authored
tests: add flaky test handling (#2527)
* chore: add flaky test handling Signed-off-by: Henry Schreiner <[email protected]> * Update test_android.py --------- Signed-off-by: Henry Schreiner <[email protected]>
1 parent 60b9cc9 commit feeb399

File tree

3 files changed

+5
-0
lines changed

3 files changed

+5
-0
lines changed

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ test = [
8888
"jinja2",
8989
"pytest-timeout",
9090
"pytest-xdist",
91+
"pytest-rerunfailures",
9192
"pytest>=6",
9293
"setuptools",
9394
"tomli_w",

test/test_android.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,8 @@ def test_android_home(tmp_path, capfd):
9090
assert "ANDROID_HOME environment variable is not set" in capfd.readouterr().err
9191

9292

93+
# Can fail to setup
94+
@pytest.mark.flaky(reruns=2)
9395
def test_frontend_good(tmp_path):
9496
new_c_project().generate(tmp_path)
9597
wheels = cibuildwheel_run(

test/test_ios.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ def skip_if_ios_testing_not_supported() -> None:
4949
# it's easy to overload the CI machine if there are multiple test processes
5050
# running multithreaded processes. Therefore, they're put in the serial group,
5151
# which is guaranteed to run single-process.
52+
# This can also fail the first time sometimes.
5253
@pytest.mark.serial
54+
@pytest.mark.flaky(reruns=2)
5355
@pytest.mark.parametrize(
5456
"build_config",
5557
[

0 commit comments

Comments
 (0)