Skip to content

Commit 1495015

Browse files
committed
TST: only retry flaky tests on CI
1 parent f97cff0 commit 1495015

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lib/matplotlib/tests/test_backends_interactive.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,7 @@ def _get_testable_interactive_backends():
127127

128128
# Reasonable safe values for slower CI/Remote and local architectures.
129129
_test_timeout = 120 if is_ci_environment() else 20
130+
_retry_count = 3 if is_ci_environment() else 0
130131

131132

132133
def _test_toolbar_button_la_mode_icon(fig):
@@ -237,7 +238,7 @@ def check_alt_backend(alt_backend):
237238

238239
@pytest.mark.parametrize("env", _get_testable_interactive_backends())
239240
@pytest.mark.parametrize("toolbar", ["toolbar2", "toolmanager"])
240-
@pytest.mark.flaky(reruns=3)
241+
@pytest.mark.flaky(reruns=_retry_count)
241242
def test_interactive_backend(env, toolbar):
242243
if env["MPLBACKEND"] == "macosx":
243244
if toolbar == "toolmanager":
@@ -329,7 +330,7 @@ def _test_thread_impl():
329330

330331

331332
@pytest.mark.parametrize("env", _thread_safe_backends)
332-
@pytest.mark.flaky(reruns=3)
333+
@pytest.mark.flaky(reruns=_retry_count)
333334
def test_interactive_thread_safety(env):
334335
proc = _run_helper(_test_thread_impl, timeout=_test_timeout, extra_env=env)
335336
assert proc.stdout.count("CloseEvent") == 1
@@ -617,7 +618,7 @@ def _test_number_of_draws_script():
617618

618619
@pytest.mark.parametrize("env", _blit_backends)
619620
# subprocesses can struggle to get the display, so rerun a few times
620-
@pytest.mark.flaky(reruns=4)
621+
@pytest.mark.flaky(reruns=_retry_count)
621622
def test_blitting_events(env):
622623
proc = _run_helper(
623624
_test_number_of_draws_script, timeout=_test_timeout, extra_env=env)

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy