]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-118201: Accomodate flaky behavior of `os.sysconf` on iOS (GH-118453)
authorRussell Keith-Magee <russell@keith-magee.com>
Wed, 1 May 2024 02:31:00 +0000 (10:31 +0800)
committerGitHub <noreply@github.com>
Wed, 1 May 2024 02:31:00 +0000 (22:31 -0400)
Lib/test/support/os_helper.py
Lib/test/test_os.py

index 8071c248b9b67ef0ebf3f36ed5ed748e82f55708..891405943b78c503da7afc31265cfeb7367963f9 100644 (file)
@@ -632,7 +632,8 @@ def fd_count():
     if hasattr(os, 'sysconf'):
         try:
             MAXFD = os.sysconf("SC_OPEN_MAX")
-        except OSError:
+        except (OSError, ValueError):
+            # gh-118201: ValueError is raised intermittently on iOS
             pass
 
     old_modes = None
index 6a34f48f7873eebcdd328ad6b73a0c9a901f170a..eaa676673f8af07a5287d8662d13a6cf58d11045 100644 (file)
@@ -2365,6 +2365,7 @@ class TestInvalidFD(unittest.TestCase):
         support.is_emscripten or support.is_wasi,
         "musl libc issue on Emscripten/WASI, bpo-46390"
     )
+    @unittest.skipIf(support.is_apple_mobile, "gh-118201: Test is flaky on iOS")
     def test_fpathconf(self):
         self.check(os.pathconf, "PC_NAME_MAX")
         self.check(os.fpathconf, "PC_NAME_MAX")