Skip to content

bpo-35513, unittest: TextTestRunner uses time.perf_counter() #11180

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 17, 2018
Merged

bpo-35513, unittest: TextTestRunner uses time.perf_counter() #11180

merged 1 commit into from
Dec 17, 2018

Conversation

vstinner
Copy link
Member

@vstinner vstinner commented Dec 16, 2018

TextTestRunner of unittest.runner now uses time.perf_counter() rather
than time.time() to measure the execution time of a test.

Similar change in libregrtest, and in pprint and random internal
tests.

https://bugs.python.org/issue35513

TextTestRunner of unittest.runner now uses time.perf_counter() rather
than time.time() to measure the execution time of a test: time.time()
can go backwards, whereas time.perf_counter() is monotonic.

Similar change in libregrtest, and in pprint and random internal
tests.
@vstinner vstinner merged commit 8db5b54 into python:master Dec 17, 2018
@vstinner vstinner deleted the time_perf_counter branch December 17, 2018 10:30
@miss-islington
Copy link
Contributor

Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.7.
🐍🍒⛏🤖

@bedevere-bot
Copy link

GH-11188 is a backport of this pull request to the 3.7 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Dec 17, 2018
…H-11180)

TextTestRunner of unittest.runner now uses time.perf_counter() rather
than time.time() to measure the execution time of a test: time.time()
can go backwards, whereas time.perf_counter() is monotonic.

Similar change made in libregrtest, pprint and random.
(cherry picked from commit 8db5b54)

Co-authored-by: Victor Stinner <[email protected]>
miss-islington added a commit that referenced this pull request Dec 17, 2018
TextTestRunner of unittest.runner now uses time.perf_counter() rather
than time.time() to measure the execution time of a test: time.time()
can go backwards, whereas time.perf_counter() is monotonic.

Similar change made in libregrtest, pprint and random.
(cherry picked from commit 8db5b54)

Co-authored-by: Victor Stinner <[email protected]>
@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure ⚠️⚠️⚠️

Hi! The buildbot x86-64 High Sierra 3.7 has failed when building commit 9ade4cb.

What do you need to do:

  1. Don't panic.
  2. Check the buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/all/#builders/147/builds/546) and take a look at the build logs.
  4. Check if the failure is related to this commit (9ade4cb) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/all/#builders/147/builds/546

Click to see traceback logs
Traceback (most recent call last):
  File "/Users/buildbot/buildarea/3.7.billenstein-sierra/build/Lib/test/test_asyncio/test_events.py", line 272, in test_run_until_complete
    self.assertTrue(0.08 <= t1-t0 <= 0.8, t1-t0)
AssertionError: False is not true : 1.2684909640000015

----------------------------------------------------------------------

Ran 2029 tests in 74.737s

FAILED (failures=1, skipped=35)


Traceback (most recent call last):
  File "/Users/buildbot/buildarea/3.7.billenstein-sierra/build/Lib/test/test_asyncio/test_events.py", line 595, in test_signal_handling_args
    self.assertEqual(caught, 1)
AssertionError: 0 != 1

----------------------------------------------------------------------

Ran 2029 tests in 69.698s

FAILED (failures=1, skipped=35)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants