File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -497,7 +497,8 @@ def test_process_time(self):
497
497
self .assertLess (stop - start , 0.020 )
498
498
499
499
# bpo-33723: A busy loop of 100 ms should increase process_time()
500
- # by at least 15 ms
500
+ # by at least 15 ms. Tolerate 15 ms because of the bad resolution of
501
+ # the clock on Windows (around 15.6 ms).
501
502
min_time = 0.015
502
503
busy_time = 0.100
503
504
@@ -535,8 +536,11 @@ def test_thread_time(self):
535
536
self .assertLess (stop - start , 0.020 )
536
537
537
538
# bpo-33723: A busy loop of 100 ms should increase thread_time()
538
- # by at least 15 ms
539
+ # by at least 15 ms, but less than 30 ms in other threads.
540
+ # Tolerate 15 and 30 ms because of the bad resolution
541
+ # of the clock on Windows (around 15.6 ms).
539
542
min_time = 0.015
543
+ max_time = 0.030
540
544
busy_time = 0.100
541
545
542
546
# thread_time() should include CPU time spent in current thread...
@@ -551,7 +555,7 @@ def test_thread_time(self):
551
555
t .start ()
552
556
t .join ()
553
557
stop = time .thread_time ()
554
- self .assertLess (stop - start , min_time )
558
+ self .assertLess (stop - start , max_time )
555
559
556
560
info = time .get_clock_info ('thread_time' )
557
561
self .assertTrue (info .monotonic )
You can’t perform that action at this time.
0 commit comments