You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Test suite manipulates system clock time, breaking other tests #162280
We run the python test suite in parallel for speed reasons, but test_time.py:test_monotonic_settime() sets the realtime clock to an hour ago (-3600s) for a moment and then resets it.
I suspect, this is the cause for occasional failures in the tests:
FAIL: test_extractall_none_mtime (test.test_tarfile.NoneInfoExtractTests_Data.test_extractall_none_mtime) (path=PosixPath('/var/volatile/tmp/test_python_0
c2fdsmi/test_python_17795√¶/@test_17795_tmp√¶-tardir/extractall_none/gnu/123/123/123/123/123'))
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib/python3.14/test/test_tarfile.py", line 3581, in test_extractall_none_mtime
self.assertGreaterEqual(path.stat().st_mtime, now)
~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: 1794589993.9077852 not greater than or equal to 1794593593.9003344
Note that the difference between those two timestamps is 3599.9925492s. I was scratching my head as to how a parent directory would be created after a file inside it, but I suspect test_tarfile and test_time were running in parallel.
I'd suggest that manipulating the system time be guarded with a feature check, on the grounds that changing the system time has effects outside of the test suite. If a developer was running the tests whilst doing other work, hitting that window could cause data loss.
Activity