gh-102184: Test os.sync() only if the "walltime" resource is enabled (GH-155448)
serhiy-storchaka <[email protected]> Mon, 10 Aug 2026 02:49:18 -0400 (EDT)
| Newsgroups | gmane.comp.python.cvs |
|---|---|
| Message-ID | <[email protected]> |
https://github.com/python/cpython/commit/e45d4560d11a83022af72dcf7f52a7d2cb704860 commit: e45d4560d11a83022af72dcf7f52a7d2cb704860 branch: main author: Serhiy Storchaka <[email protected]> committer: serhiy-storchaka <[email protected]> date: 2026-08-10T09:49:03+03:00 summary: gh-102184: Test os.sync() only if the "walltime" resource is enabled (GH-155448) Calling sync() flushes all filesystem buffers and can block for a long time, so it should not run in the default test suite. Co-authored-by: Alexey Izbyshev <[email protected]> files: M Lib/test/test_os/test_posix.py diff --git a/Lib/test/test_os/test_posix.py b/Lib/test/test_os/test_posix.py index 8743b0bf0bc4939..f3d67027ad37277 100644 --- a/Lib/test/test_os/test_posix.py +++ b/Lib/test/test_os/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]