From 1900796eaabe312785fc784a87e6ef8d8368ba7b Mon Sep 17 00:00:00 2001 From: Ned Batchelder Date: Tue, 17 Jan 2017 20:23:35 -0500 Subject: Use @flaky to prevent occasional multiprocessing failures --- igor.py | 1 + requirements/pytest.pip | 1 + setup.cfg | 2 +- tests/test_concurrency.py | 3 +++ 4 files changed, 6 insertions(+), 1 deletion(-) diff --git a/igor.py b/igor.py index 9d2d43a0..c875a6f9 100644 --- a/igor.py +++ b/igor.py @@ -28,6 +28,7 @@ warnings.simplefilter("default") # Silence specific warnings that are not our fault. warnings.filterwarnings("ignore", module="xdist", message="type argument to addoption") +warnings.filterwarnings("ignore", module="flaky", message="type argument to addoption") warnings.filterwarnings( # https://github.com/pytest-dev/pytest/issues/2118 "ignore", diff --git a/requirements/pytest.pip b/requirements/pytest.pip index e2e70090..274168ff 100644 --- a/requirements/pytest.pip +++ b/requirements/pytest.pip @@ -5,3 +5,4 @@ pytest==3.0.5 pytest-xdist==1.15.0 pytest-warnings==0.2.0 +flaky==3.3.0 diff --git a/setup.cfg b/setup.cfg index c88d0160..07eb45cd 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,5 +1,5 @@ [tool:pytest] -addopts = -q -n3 --strict +addopts = -q -n3 --strict --no-success-flaky-report markers = expensive: too slow to run during "make smoke" diff --git a/tests/test_concurrency.py b/tests/test_concurrency.py index a7dac064..f2aa7977 100644 --- a/tests/test_concurrency.py +++ b/tests/test_concurrency.py @@ -5,6 +5,8 @@ import threading +from flaky import flaky + import coverage from coverage import env from coverage.files import abs_file @@ -349,6 +351,7 @@ MULTI_CODE = """ """ +@flaky # Sometimes a test fails due to inherent randomness. Try one more time. class MultiprocessingTest(CoverageTest): """Test support of the multiprocessing module.""" -- cgit v1.2.1