Skip to content

Commit 2ae655b

Browse files
asm89pytorchmergebot
authored andcommittedFeb 13, 2024
caffe2: remove support for specifically running "flaky tests" (pytorch#112007)
Summary: In March 2019 D14468816 introduced some infra to mark tests as flaky while still running them. In July 2019 D15797371 removed the last use of this feature. Remove the related code as well. Test Plan: ci Reviewed By: mlogachev Differential Revision: D50601204 Pull Request resolved: pytorch#112007 Approved by: https://github.com/malfet
1 parent 60148f1 commit 2ae655b

File tree

1 file changed

+0
-25
lines changed

1 file changed

+0
-25
lines changed
 

‎caffe2/python/test_util.py

-25
Original file line numberDiff line numberDiff line change
@@ -57,22 +57,6 @@ def get_default_test_flags():
5757
]
5858

5959

60-
def caffe2_flaky(test_method):
61-
# This decorator is used to mark a test method as flaky.
62-
# This is used in conjunction with the environment variable
63-
# CAFFE2_RUN_FLAKY_TESTS that specifies "flaky tests" mode
64-
# If flaky tests mode are on, only flaky tests are run
65-
# If flaky tests mode are off, only non-flaky tests are run
66-
# NOTE: the decorator should be applied as the top-level decorator
67-
# in a test method.
68-
test_method.__caffe2_flaky__ = True
69-
return test_method
70-
71-
72-
def is_flaky_test_mode():
73-
return os.getenv('CAFFE2_RUN_FLAKY_TESTS', '0') == '1'
74-
75-
7660
class TestCase(unittest.TestCase):
7761
@classmethod
7862
def setUpClass(cls):
@@ -82,15 +66,6 @@ def setUpClass(cls):
8266
core.SetEnginePref({}, {})
8367

8468
def setUp(self):
85-
# Skip tests based on whether we're in flaky test mode and
86-
# the test is decorated as a flaky test.
87-
test_method = getattr(self, self._testMethodName)
88-
is_flaky_test = getattr(test_method, "__caffe2_flaky__", False)
89-
if (is_flaky_test_mode() and not is_flaky_test):
90-
raise unittest.SkipTest("Non-flaky tests are skipped in flaky test mode")
91-
elif (not is_flaky_test_mode() and is_flaky_test):
92-
raise unittest.SkipTest("Flaky tests are skipped in regular test mode")
93-
9469
self.ws = workspace.C.Workspace()
9570
workspace.ResetWorkspace()
9671

0 commit comments

Comments
 (0)