From 29667d55e0d5a06f2a176e9a51fbf8e18fee5ee8 Mon Sep 17 00:00:00 2001 From: Victor Stinner Date: Thu, 12 Jul 2018 12:41:23 +0200 Subject: [PATCH] bpo-33723: Remove time.thread_time() functional tests These functional tests were too fragile: we already tolerate to only get a delta of 20 ms whereas the test runs a busy loop during 100 ms. The test failed on a buildbot because the delta was only 19 ms. Reducing the minimum delta would make the test meaningless, so remove it instead. --- Lib/test/test_time.py | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/Lib/test/test_time.py b/Lib/test/test_time.py index eda3885ad575f3..84a175e899db7c 100644 --- a/Lib/test/test_time.py +++ b/Lib/test/test_time.py @@ -529,19 +529,10 @@ def test_thread_time(self): # on Windows self.assertLess(stop - start, 0.020) - # thread_time() should include CPU time spent in current thread... - start = time.thread_time() - busy_wait(0.100) - stop = time.thread_time() - self.assertGreaterEqual(stop - start, 0.020) # machine busy? - - # ...but not in other threads - t = threading.Thread(target=busy_wait, args=(0.100,)) - start = time.thread_time() - t.start() - t.join() - stop = time.thread_time() - self.assertLess(stop - start, 0.020) + # bpo-33723: Previously, there were functional tests to make sure that + # time.thread_time() doesn't account time of a busy loop in a different + # thread, but these tests have been removed because they were too + # fragile. info = time.get_clock_info('thread_time') self.assertTrue(info.monotonic)