bpo-33873: Fix bug in runtest.py
and add checks for invalid -R
parameters by pablogsal · Pull Request #7735 · python/cpython (original) (raw)
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 andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Conversation13 Commits4 Checks0 Files changed
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
[ Show hidden characters]({{ revealButtonHref }})
… an extra time than specified
I have added the checks for the --huntrleaks/-R
in Regrtest._main
to avoid entering Regrtest.run_test
and do the sys.exit()
there but I am not sure what is the best location. Also, I used a new errorcode (2) but again, not sure if we want a custom error code for that.
pablogsal changed the title
bpo-33873: Fix bug in bpo-33873: Fix bug in runtest.py
that makes running tests an extra timeruntest.py
and add checks for invalid -R
parameters
~/github/cpython bpo33873 ✔ 8s ❯ ./python -m test -R 0:0 test_os -m test_access Invalid values for the --huntrleaks/-R parameters
~/github/cpython bpo33873 ✔ ❯ ./python -m test -R 0:1 test_os -m test_access Invalid values for the --huntrleaks/-R parameters
~/github/cpython bpo33873 ✔ ❯ ./python -m test -R 1:0 test_os -m test_access Invalid values for the --huntrleaks/-R parameters
~/github/cpython bpo33873 ✔ ❯ ./python -m test -R 0:-2 test_list Invalid values for the --huntrleaks/-R parameters
if self.ns.huntrleaks: |
---|
warmup, repetitions, _ = self.ns.huntrleaks |
if warmup < 1 or repetitions < 1: |
print("Invalid values for the --huntrleaks/-R parameters", |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You must mention the minimum number of warmups and minimum number of repetitions (1 and 1).
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IMHO a NEWS entry would be worth it here. You can use the name "regrtest" to name the CPython test runner libregrtest.
if warmup < 1 or repetitions < 1: |
---|
msg = ("Invalid values for the --huntrleaks/-R parameters. The " |
"number of warmups and repetitions must be at least 1 " |
"each (1:1).") |
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nitpick: maybe write "(-R 1:1)" rather than "(1:1)"?
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Since you are now a core dev, would you like to merge it yourself? :-)
"VSTS: docs — docs_20180616.05 failed"
I don't understand the failure. It says "Initialize phase: Failed" but I don't see any failure in logs. I suggest to ignore this error.
@pablogsal: The change LGTM, do you want to merge it? It would help me to work on my PR #7827.
Thanks @pablogsal for the PR 🌮🎉.. I'm working now to backport this PR to: 3.7.
🐍🍒⛏🤖
Thanks @pablogsal for the PR 🌮🎉.. I'm working now to backport this PR to: 3.6.
🐍🍒⛏🤖
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request
…rameters (pythonGH-7735)
Fix bug in Lib/test/libregrtest/runtest.py
that makes running tests an extra time than the specified number of runs.
Add check for invalid --huntrleaks/-R parameters. (cherry picked from commit 58ed730)
Co-authored-by: Pablo Galindo Pablogsal@gmail.com
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request
…rameters (pythonGH-7735)
Fix bug in Lib/test/libregrtest/runtest.py
that makes running tests an extra time than the specified number of runs.
Add check for invalid --huntrleaks/-R parameters. (cherry picked from commit 58ed730)
Co-authored-by: Pablo Galindo Pablogsal@gmail.com
This was referenced
Jun 26, 2018
vstinner added a commit that referenced this pull request
bpo-33718: regrtest: use format_duration() to display failed tests (GH-7686)
Enhance also format_duration(): work on integers and rounds towards +infinity (math.ceil).
Write unit tests on format_duration()
(cherry picked from commit 4ffe9c2)
regrtest: Add warning when using less than 3 warmup runs like -R 1:3. (cherry picked from commit cac4fef)
Fix bug in Lib/test/libregrtest/runtest.py
that makes running tests an extra time than the specified number of runs.
Add check for invalid --huntrleaks/-R parameters.
(cherry picked from commit 58ed730)
vstinner added a commit that referenced this pull request
bpo-33718: regrtest: use format_duration() to display failed tests (GH-7686)
Enhance also format_duration(): work on integers and rounds towards +infinity (math.ceil).
Write unit tests on format_duration()
(cherry picked from commit 4ffe9c2)
regrtest: Add warning when using less than 3 warmup runs like -R 1:3.
(cherry picked from commit cac4fef)
Fix bug in Lib/test/libregrtest/runtest.py
that makes running tests an extra time than the specified number of runs.
Add check for invalid --huntrleaks/-R parameters.
(cherry picked from commit 58ed730)
vstinner added a commit that referenced this pull request
bpo-33718: regrtest: use format_duration() to display failed tests (GH-7686)
Enhance also format_duration(): work on integers and rounds towards +infinity (math.ceil).
Write unit tests on format_duration()
(cherry picked from commit 4ffe9c2)
regrtest: Add warning when using less than 3 warmup runs like -R 1:3. (cherry picked from commit cac4fef)
Fix bug in Lib/test/libregrtest/runtest.py
that makes running tests an extra time than the specified number of runs.
Add check for invalid --huntrleaks/-R parameters.
(cherry picked from commit 58ed730) (cherry picked from commit d1f9481)