@@ -47,12 +47,6 @@ class _PyTime(enum.IntEnum):
47
47
)
48
48
49
49
50
- def busy_wait (duration ):
51
- deadline = time .monotonic () + duration
52
- while time .monotonic () < deadline :
53
- pass
54
-
55
-
56
50
class TimeTestCase (unittest .TestCase ):
57
51
58
52
def setUp (self ):
@@ -496,25 +490,6 @@ def test_process_time(self):
496
490
# on Windows
497
491
self .assertLess (stop - start , 0.020 )
498
492
499
- # bpo-33723: A busy loop of 100 ms should increase process_time()
500
- # by at least 15 ms. Tolerate 15 ms because of the bad resolution of
501
- # the clock on Windows (around 15.6 ms).
502
- min_time = 0.015
503
- busy_time = 0.100
504
-
505
- # process_time() should include CPU time spent in any thread
506
- start = time .process_time ()
507
- busy_wait (busy_time )
508
- stop = time .process_time ()
509
- self .assertGreaterEqual (stop - start , min_time )
510
-
511
- t = threading .Thread (target = busy_wait , args = (busy_time ,))
512
- start = time .process_time ()
513
- t .start ()
514
- t .join ()
515
- stop = time .process_time ()
516
- self .assertGreaterEqual (stop - start , min_time )
517
-
518
493
info = time .get_clock_info ('process_time' )
519
494
self .assertTrue (info .monotonic )
520
495
self .assertFalse (info .adjustable )
@@ -535,28 +510,6 @@ def test_thread_time(self):
535
510
# on Windows
536
511
self .assertLess (stop - start , 0.020 )
537
512
538
- # bpo-33723: A busy loop of 100 ms should increase thread_time()
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).
542
- min_time = 0.015
543
- max_time = 0.030
544
- busy_time = 0.100
545
-
546
- # thread_time() should include CPU time spent in current thread...
547
- start = time .thread_time ()
548
- busy_wait (busy_time )
549
- stop = time .thread_time ()
550
- self .assertGreaterEqual (stop - start , min_time )
551
-
552
- # ...but not in other threads
553
- t = threading .Thread (target = busy_wait , args = (busy_time ,))
554
- start = time .thread_time ()
555
- t .start ()
556
- t .join ()
557
- stop = time .thread_time ()
558
- self .assertLess (stop - start , max_time )
559
-
560
513
info = time .get_clock_info ('thread_time' )
561
514
self .assertTrue (info .monotonic )
562
515
self .assertFalse (info .adjustable )
0 commit comments