Skip to content

Commit ff99345

Browse files
committed
gh-159739: Remove the realloc failure test from test__tuple_resize
It relied on a huge allocation request failing, which is not portable: TSan aborts on it and it succeeds on wasm32 (WASI).
1 parent db04f57 commit ff99345

1 file changed

Lines changed: 0 additions & 9 deletions

File tree

‎Lib/test/test_capi/test_tuple.py‎

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -331,15 +331,6 @@ def test__tuple_resize(self):
331331
self.assertRaises(MemoryError, resize, a, PY_SSIZE_T_MAX)
332332
self.assertRaises(SystemError, resize, a, -1)
333333
self.assertRaises(SystemError, resize, a, PY_SSIZE_T_MIN)
334-
# gh-159739: items are released if the reallocation fails
335-
x = object()
336-
refcnt = getrefcount(x)
337-
a = (x, x, x)
338-
# Too large to allocate, but small enough not to overflow.
339-
newsize = PY_SSIZE_T_MAX // _testcapi.SIZEOF_VOID_P - 100
340-
self.assertRaises(MemoryError, resize, a, newsize)
341-
del a
342-
self.assertEqual(getrefcount(x), refcnt)
343334
# refcount > 1
344335
a = (1, 2, 3)
345336
self.assertRaises(SystemError, resize, a, 3, False)

0 commit comments

Comments
 (0)