From 9b311b35eda7664cec076bc89690329523bc271b Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Fri, 21 Feb 2025 07:50:25 +0800 Subject: [PATCH] Skip a test_getallocatedblocks test pre-condition on iOS. --- Lib/test/test_sys.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Lib/test/test_sys.py b/Lib/test/test_sys.py index 39857445a02255..cc50f97607210b 100644 --- a/Lib/test/test_sys.py +++ b/Lib/test/test_sys.py @@ -1100,7 +1100,13 @@ def test_getallocatedblocks(self): # code objects is a large fraction of the total number of # references, this can cause the total number of allocated # blocks to exceed the total number of references. - if not support.Py_GIL_DISABLED: + # + # For some reason, iOS seems to trigger the "unlikely to happen" + # case reliably under CI conditions. It's not clear why; but as + # this test is checking the behavior of getallocatedblock() + # under garbage collection, we can skip this pre-condition check + # for now. See GH-130384. + if not support.Py_GIL_DISABLED and not support.is_apple_mobile: self.assertLess(a, sys.gettotalrefcount()) except AttributeError: # gettotalrefcount() not available