Skip to content

Commit c94caca

Browse files
authored
bpo-30649: test_os tolerates 50 ms delta for utime (#2156)
On Windows, tolerate a delta of 50 ms instead of 20 ms in test_utime_current() and test_utime_current_old() of test_os. On other platforms, reduce the delta from 20 ms to 10 ms.
1 parent 184bd82 commit c94caca

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

Lib/test/test_os.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -621,9 +621,12 @@ def _test_utime_current(self, set_time):
621621

622622
if not self.support_subsecond(self.fname):
623623
delta = 1.0
624+
elif os.name == 'nt':
625+
# On Windows, the usual resolution of time.time() is 15.6 ms.
626+
# bpo-30649: Tolerate 50 ms for slow Windows buildbots.
627+
delta = 0.050
624628
else:
625-
# On Windows, the usual resolution of time.time() is 15.6 ms
626-
delta = 0.020
629+
delta = 0.010
627630
st = os.stat(self.fname)
628631
msg = ("st_time=%r, current=%r, dt=%r"
629632
% (st.st_mtime, current, st.st_mtime - current))

0 commit comments

Comments
 (0)