This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients Nitapol, lukasz.langa, miss-islington, ned.deily, rhettinger, ronaldoussoren, rvijayak, vstinner
Date 2019-08-27.07:22:39
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
On PR 12287, Ned Deily wrote:
> I still think it would be better to have a test for this case since the problem embarrassingly went undetected for quite some time. But I'll let some one else deal with it if they care to.

test_time already contains a functional test on time.process_time() to ensure that sleep isn't included in process time:

    def test_process_time(self):
        # process_time() should not include time spend during a sleep
        start = time.process_time()
        stop = time.process_time()
        # use 20 ms because process_time() has usually a resolution of 15 ms
        # on Windows
        self.assertLess(stop - start, 0.020)

        info = time.get_clock_info('process_time')

Writing tests on clocks is really hard, since every single platform has a different resolution. Previous attempts to write "accurate" tests on clock caused a lot of flaky tests making our CIs fail randomly. We removed some tests because of that.
Date User Action Args
2019-08-27 07:22:40vstinnersetrecipients: + vstinner, rhettinger, ronaldoussoren, ned.deily, lukasz.langa, miss-islington, rvijayak, Nitapol
2019-08-27 07:22:40vstinnersetmessageid: <>
2019-08-27 07:22:40vstinnerlinkissue36205 messages
2019-08-27 07:22:39vstinnercreate