@@ -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
132133def _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 )
241242def 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 )
333334def 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 )
621622def test_blitting_events (env ):
622623 proc = _run_helper (
623624 _test_number_of_draws_script , timeout = _test_timeout , extra_env = env )
0 commit comments