Skip to content

Commit b98f05f

Browse files
committed
[GR-46050] Add a skiplist to skip certain unittests on some of our CI platforms
1 parent 6941c52 commit b98f05f

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

graalpython/com.oracle.graal.python.test/src/tests/test_tagged_unittests.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,16 @@
5454
RUNNER = os.path.join(os.path.dirname(__file__), "run_cpython_test.py")
5555
LINE = "=" * 80
5656

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+
5767

5868
def grouper(iterable, n):
5969
args = [iter(iterable)] * n
@@ -166,7 +176,17 @@ class TestTaggedUnittests(unittest.TestCase):
166176
selection = set(s.strip() for s in selection.split(","))
167177
working_tests = [x for x in working_tests if x[0] in selection]
168178

179+
this_os = sys.platform
180+
this_machine = os.uname().machine
169181
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
170190
fn = make_test_function(working_test)
171191
fn.__name__ = "%s[%d/%d]" % (fn.__name__, idx + 1, len(working_tests))
172192
fn.__qualname__ = "%s.%s" % (TestTaggedUnittests.__name__, fn.__name__)

0 commit comments

Comments
 (0)