]> granicus.if.org Git - python/commitdiff
bpo-30649: test_os tolerates 50 ms delta for utime (#2156)
authorVictor Stinner <victor.stinner@gmail.com>
Tue, 13 Jun 2017 21:48:27 +0000 (23:48 +0200)
committerGitHub <noreply@github.com>
Tue, 13 Jun 2017 21:48:27 +0000 (23:48 +0200)
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.

Lib/test/test_os.py

index 4a21ff762dcaa1e842347a88e852fa68e44a2f8b..bc1b0eeeac9004abe48372c1bcf737a0dd85e807 100644 (file)
@@ -621,9 +621,12 @@ class UtimeTests(unittest.TestCase):
 
         if not self.support_subsecond(self.fname):
             delta = 1.0
+        elif os.name == 'nt':
+            # On Windows, the usual resolution of time.time() is 15.6 ms.
+            # bpo-30649: Tolerate 50 ms for slow Windows buildbots.
+            delta = 0.050
         else:
-            # On Windows, the usual resolution of time.time() is 15.6 ms
-            delta = 0.020
+            delta = 0.010
         st = os.stat(self.fname)
         msg = ("st_time=%r, current=%r, dt=%r"
                % (st.st_mtime, current, st.st_mtime - current))