|
54 | 54 | RUNNER = os.path.join(os.path.dirname(__file__), "run_cpython_test.py")
|
55 | 55 | LINE = "=" * 80
|
56 | 56 |
|
| 57 | +# some CI platforms are more unstable then others when it comes to tests |
| 58 | +# involving many files, sockets, or threads. We skip some tests on some |
| 59 | +# platforms |
| 60 | +SKIPLIST = ( |
| 61 | + ("darwin", None, "test_smtplib"), |
| 62 | + ("darwin", None, "test_imaplib"), |
| 63 | + (None, "arm", "test_multiprocessing_spawn"), |
| 64 | + (None, "aarch64", "test_multiprocessing_spawn"), |
| 65 | +) |
| 66 | + |
57 | 67 |
|
58 | 68 | def grouper(iterable, n):
|
59 | 69 | args = [iter(iterable)] * n
|
@@ -166,7 +176,17 @@ class TestTaggedUnittests(unittest.TestCase):
|
166 | 176 | selection = set(s.strip() for s in selection.split(","))
|
167 | 177 | working_tests = [x for x in working_tests if x[0] in selection]
|
168 | 178 |
|
| 179 | + this_os = sys.platform |
| 180 | + this_machine = os.uname().machine |
169 | 181 | for idx, working_test in enumerate(working_tests):
|
| 182 | + if os.environ.get("CI", None) and any( |
| 183 | + (os is None or os in this_os) |
| 184 | + and (machine is None or machine in this_machine) |
| 185 | + and test == working_test[0] |
| 186 | + for os, machine, test in SKIPLIST |
| 187 | + ): |
| 188 | + print("Skipping test from skiplist for this platform:", working_test[0]) |
| 189 | + continue |
170 | 190 | fn = make_test_function(working_test)
|
171 | 191 | fn.__name__ = "%s[%d/%d]" % (fn.__name__, idx + 1, len(working_tests))
|
172 | 192 | fn.__qualname__ = "%s.%s" % (TestTaggedUnittests.__name__, fn.__name__)
|
|
0 commit comments