Rerun flaky profiler tests on failure (#10035)

This commit is contained in:
kingyiusuen 2021-10-20 08:27:04 -05:00 committed by GitHub
parent f0b3e0f4de
commit 2ed92ecabb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions

View File

@ -1,6 +1,7 @@
coverage>5.2.0 coverage>5.2.0
codecov>=2.1 codecov>=2.1
pytest>=6.0 pytest>=6.0
pytest-rerunfailures>=10.2
check-manifest check-manifest
twine==3.2 twine==3.2
mypy>=0.900 mypy>=0.900

View File

@ -52,6 +52,7 @@ def simple_profiler():
return SimpleProfiler() return SimpleProfiler()
@pytest.mark.flaky(reruns=3)
@pytest.mark.parametrize(["action", "expected"], [("a", [3, 1]), ("b", [2]), ("c", [1])]) @pytest.mark.parametrize(["action", "expected"], [("a", [3, 1]), ("b", [2]), ("c", [1])])
def test_simple_profiler_durations(simple_profiler, action: str, expected: list): def test_simple_profiler_durations(simple_profiler, action: str, expected: list):
"""Ensure the reported durations are reasonably accurate.""" """Ensure the reported durations are reasonably accurate."""
@ -65,6 +66,7 @@ def test_simple_profiler_durations(simple_profiler, action: str, expected: list)
np.testing.assert_allclose(simple_profiler.recorded_durations[action], expected, rtol=0.2) np.testing.assert_allclose(simple_profiler.recorded_durations[action], expected, rtol=0.2)
@pytest.mark.flaky(reruns=3)
@pytest.mark.parametrize(["action", "expected"], [("a", [3, 1]), ("b", [2]), ("c", [1])]) @pytest.mark.parametrize(["action", "expected"], [("a", [3, 1]), ("b", [2]), ("c", [1])])
def test_simple_profiler_iterable_durations(simple_profiler, action: str, expected: list): def test_simple_profiler_iterable_durations(simple_profiler, action: str, expected: list):
"""Ensure the reported durations are reasonably accurate.""" """Ensure the reported durations are reasonably accurate."""
@ -159,6 +161,7 @@ def advanced_profiler(tmpdir):
return AdvancedProfiler(dirpath=tmpdir, filename="profiler") return AdvancedProfiler(dirpath=tmpdir, filename="profiler")
@pytest.mark.flaky(reruns=3)
@pytest.mark.parametrize(["action", "expected"], [("a", [3, 1]), ("b", [2]), ("c", [1])]) @pytest.mark.parametrize(["action", "expected"], [("a", [3, 1]), ("b", [2]), ("c", [1])])
def test_advanced_profiler_durations(advanced_profiler, action: str, expected: list): def test_advanced_profiler_durations(advanced_profiler, action: str, expected: list):
@ -173,6 +176,7 @@ def test_advanced_profiler_durations(advanced_profiler, action: str, expected: l
np.testing.assert_allclose(recored_total_duration, expected_total_duration, rtol=0.2) np.testing.assert_allclose(recored_total_duration, expected_total_duration, rtol=0.2)
@pytest.mark.flaky(reruns=3)
@pytest.mark.parametrize(["action", "expected"], [("a", [3, 1]), ("b", [2]), ("c", [1])]) @pytest.mark.parametrize(["action", "expected"], [("a", [3, 1]), ("b", [2]), ("c", [1])])
def test_advanced_profiler_iterable_durations(advanced_profiler, action: str, expected: list): def test_advanced_profiler_iterable_durations(advanced_profiler, action: str, expected: list):
"""Ensure the reported durations are reasonably accurate.""" """Ensure the reported durations are reasonably accurate."""