[3.13] gh-102184: Test os.sync() only if the "walltime" resource is enabled (GH-155448) (GH-155463)
serhiy-storchaka <[email protected]> Mon, 10 Aug 2026 03:14:38 -0400 (EDT)
| Newsgroups | gmane.comp.python.cvs |
|---|---|
| Message-ID | <[email protected]> |
https://github.com/python/cpython/commit/cada590bad408a085fc970072bd8e40e1debfec9 commit: cada590bad408a085fc970072bd8e40e1debfec9 branch: 3.13 author: Miss Islington (bot) <[email protected]> committer: serhiy-storchaka <[email protected]> date: 2026-08-10T07:14:23Z summary: [3.13] gh-102184: Test os.sync() only if the "walltime" resource is enabled (GH-155448) (GH-155463) Calling sync() flushes all filesystem buffers and can block for a long time, so it should not run in the default test suite. (cherry picked from commit e45d4560d11a83022af72dcf7f52a7d2cb704860) Co-authored-by: Serhiy Storchaka <[email protected]> Co-authored-by: Alexey Izbyshev <[email protected]> files: M Lib/test/test_posix.py diff --git a/Lib/test/test_posix.py b/Lib/test/test_posix.py index b2e2c65baa1e43..bde81ef41bf227 100644 --- a/Lib/test/test_posix.py +++ b/Lib/test/test_posix.py @@ -71,7 +71,7 @@ def testNoArgFunctions(self): NO_ARG_FUNCTIONS = [ "ctermid", "getcwd", "getcwdb", "uname", "times", "getloadavg", "getegid", "geteuid", "getgid", "getgroups", - "getpid", "getpgrp", "getppid", "getuid", "sync", + "getpid", "getpgrp", "getppid", "getuid", ] for name in NO_ARG_FUNCTIONS: @@ -81,6 +81,13 @@ def testNoArgFunctions(self): posix_func() self.assertRaises(TypeError, posix_func, 1) + # gh-102184: sync() can block for a long time. + @support.requires_resource('walltime') + @unittest.skipUnless(hasattr(posix, 'sync'), 'test needs posix.sync()') + def test_sync(self): + posix.sync() + self.assertRaises(TypeError, posix.sync, 1) + @unittest.skipUnless(hasattr(posix, 'getresuid'), 'test needs posix.getresuid()') def test_getresuid(self): _______________________________________________ Python-checkins mailing list -- [email protected] To unsubscribe send an email to [email protected] https://mail.python.org/mailman3//lists/python-checkins.python.org Member address: [email protected]