Skip to content

Commit

Permalink
Skip prohibitively slow tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mpage committed Apr 10, 2024
1 parent 509dac0 commit 1d44c87
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Lib/test/test_weakref.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,11 @@ def collect():
t.join()


skip_if_tsan_and_gil_disabled = unittest.skipIf(
support.check_sanitizer(thread=True) and support.Py_GIL_DISABLED,
"Test is prohibitively slow with TSAN enabled and the GIL disabled")


class ReferencesTestCase(TestBase):

def test_basic_ref(self):
Expand Down Expand Up @@ -1877,6 +1882,7 @@ def test_make_weak_keyed_dict_repr(self):
self.assertRegex(repr(dict), '<WeakKeyDictionary at 0x.*>')

@threading_helper.requires_working_threading()
@skip_if_tsan_and_gil_disabled
def test_threaded_weak_valued_setdefault(self):
d = weakref.WeakValueDictionary()
with collect_in_thread():
Expand All @@ -1886,6 +1892,7 @@ def test_threaded_weak_valued_setdefault(self):
del x

@threading_helper.requires_working_threading()
@skip_if_tsan_and_gil_disabled
def test_threaded_weak_valued_pop(self):
d = weakref.WeakValueDictionary()
with collect_in_thread():
Expand All @@ -1895,6 +1902,7 @@ def test_threaded_weak_valued_pop(self):
self.assertIsNot(x, None) # we never put None in there!

@threading_helper.requires_working_threading()
@skip_if_tsan_and_gil_disabled
def test_threaded_weak_valued_consistency(self):
# Issue #28427: old keys should not remove new values from
# WeakValueDictionary when collecting from another thread.
Expand Down

0 comments on commit 1d44c87

Please sign in to comment.