-
-
Notifications
You must be signed in to change notification settings - Fork 31.4k
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
gh-115720: Show number of leaks in huntrleaks progress reports #115726
Conversation
Instead of showing a dot for each iteration, show: - '.' for warmup or no leaks - number of leaks for 1-9 - 'X' if there are more leaks This allows more rapid iteration: I don't need to wait for the final report to see if the test still leaks.
symbol = 'X' | ||
if i == warmups: | ||
print(' ', end='', file=sys.stderr, flush=True) | ||
print(symbol, end='', file=sys.stderr, flush=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To avoid any risk of side effect of that code, I suggest to add a get_symbol() function which would look into a pre-computed array for values <= 10. Something like:
symbols = ['.'] + [str(i) for i in range(1, 10)] + ['X']
def get_symbol(value):
return symbols[min(max(value, 0), 10)]
else: | ||
symbol = 'X' | ||
if i == warmups: | ||
print(' ', end='', file=sys.stderr, flush=True) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is lovely, thanks :-)
Lib/test/libregrtest/refleak.py
Outdated
if total_leaks <= 0: | ||
symbol = '.' | ||
elif total_leaks < 10: | ||
symbol = str(total_leaks) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@vstinner instead of the function, maybe selecting a tuple of single-char strings would work better?
symbol = str(total_leaks) | |
symbol = ( | |
'.', '1', '2', '3', '4', '5', '6', '7', '8', '9', | |
)[total_leaks] |
The problem is how to display negative numbers: #115725 |
Ah! Good point. Tomorrow I'll update this to make cases like |
veru good |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not fully convinced that it's a good idea to display intermediate results when we consider that there is no leak. As you saw with test_uuid, leaks can be subtle :-( There are worse cases such as #80741 which are really hard to reproduce and look like false alarms.
We already display values when we consider that there is a leak, and it's maybe enough?
If you have a lot of free time, you can change check_rc_deltas()
heuristic to be stricter. But be careful of the rabbit hole, many people lost their mind in the Wonderland of reference leaks :-D
What about showing the full result if it's suspicious (i.e. not all zeros), but using the current heuristic for failure (for now)?
The heuristic is good (for now) for keeping CI green, but for bisecting I want to have all the info. |
@vstinner Does this sound reasonable? |
…ythonGH-115726) Instead of showing a dot for each iteration, show: - '.' for zero (on negative) leaks - number of leaks for 1-9 - 'X' if there are more leaks This allows more rapid iteration: when bisecting, I don't need to wait for the final report to see if the test still leaks. Also, show the full result if there are any non-zero entries. This shows negative entries, for the unfortunate cases where a reference is created and cleaned up in different runs. Test *failure* is still determined by the existing heuristic.
…ythonGH-115726) Instead of showing a dot for each iteration, show: - '.' for zero (on negative) leaks - number of leaks for 1-9 - 'X' if there are more leaks This allows more rapid iteration: when bisecting, I don't need to wait for the final report to see if the test still leaks. Also, show the full result if there are any non-zero entries. This shows negative entries, for the unfortunate cases where a reference is created and cleaned up in different runs. Test *failure* is still determined by the existing heuristic.
…ythonGH-115726) Instead of showing a dot for each iteration, show: - '.' for zero (on negative) leaks - number of leaks for 1-9 - 'X' if there are more leaks This allows more rapid iteration: when bisecting, I don't need to wait for the final report to see if the test still leaks. Also, show the full result if there are any non-zero entries. This shows negative entries, for the unfortunate cases where a reference is created and cleaned up in different runs. Test *failure* is still determined by the existing heuristic. (cherry picked from commit af5f9d6)
…ythonGH-115726) Instead of showing a dot for each iteration, show: - '.' for zero (on negative) leaks - number of leaks for 1-9 - 'X' if there are more leaks This allows more rapid iteration: when bisecting, I don't need to wait for the final report to see if the test still leaks. Also, show the full result if there are any non-zero entries. This shows negative entries, for the unfortunate cases where a reference is created and cleaned up in different runs. Test *failure* is still determined by the existing heuristic. (cherry picked from commit af5f9d6)
…nch (#117250) * gh-115122: Add --bisect option to regrtest (#115123) * test.bisect_cmd now exit with code 0 on success, and code 1 on failure. Before, it was the opposite. * test.bisect_cmd now runs the test worker process with -X faulthandler. * regrtest RunTests: Add create_python_cmd() and bisect_cmd() methods. (cherry picked from commit 1e5719a) * gh-115720: Show number of leaks in huntrleaks progress reports (GH-115726) Instead of showing a dot for each iteration, show: - '.' for zero (on negative) leaks - number of leaks for 1-9 - 'X' if there are more leaks This allows more rapid iteration: when bisecting, I don't need to wait for the final report to see if the test still leaks. Also, show the full result if there are any non-zero entries. This shows negative entries, for the unfortunate cases where a reference is created and cleaned up in different runs. Test *failure* is still determined by the existing heuristic. (cherry picked from commit af5f9d6) * gh-83434: Disable XML in regrtest when -R option is used (#117232) (cherry picked from commit d52bdfb) --------- Co-authored-by: Petr Viktorin <encukou@gmail.com>
…in branch (pythonGH-117250) * pythongh-115122: Add --bisect option to regrtest (pythonGH-115123) * test.bisect_cmd now exit with code 0 on success, and code 1 on failure. Before, it was the opposite. * test.bisect_cmd now runs the test worker process with -X faulthandler. * regrtest RunTests: Add create_python_cmd() and bisect_cmd() methods. (cherry picked from commit 1e5719a) * pythongh-115720: Show number of leaks in huntrleaks progress reports (pythonGH-115726) Instead of showing a dot for each iteration, show: - '.' for zero (on negative) leaks - number of leaks for 1-9 - 'X' if there are more leaks This allows more rapid iteration: when bisecting, I don't need to wait for the final report to see if the test still leaks. Also, show the full result if there are any non-zero entries. This shows negative entries, for the unfortunate cases where a reference is created and cleaned up in different runs. Test *failure* is still determined by the existing heuristic. (cherry picked from commit af5f9d6) * pythongh-83434: Disable XML in regrtest when -R option is used (pythonGH-117232) (cherry picked from commit d52bdfb) --------- (cherry picked from commit 477ef90) Co-authored-by: Victor Stinner <vstinner@python.org> Co-authored-by: Petr Viktorin <encukou@gmail.com>
…ain branch (GH-117250) (#117251) [3.12] gh-83434: Sync libregrtest and test_regrtest with the main branch (GH-117250) * gh-115122: Add --bisect option to regrtest (GH-115123) * test.bisect_cmd now exit with code 0 on success, and code 1 on failure. Before, it was the opposite. * test.bisect_cmd now runs the test worker process with -X faulthandler. * regrtest RunTests: Add create_python_cmd() and bisect_cmd() methods. (cherry picked from commit 1e5719a) * gh-115720: Show number of leaks in huntrleaks progress reports (GH-115726) Instead of showing a dot for each iteration, show: - '.' for zero (on negative) leaks - number of leaks for 1-9 - 'X' if there are more leaks This allows more rapid iteration: when bisecting, I don't need to wait for the final report to see if the test still leaks. Also, show the full result if there are any non-zero entries. This shows negative entries, for the unfortunate cases where a reference is created and cleaned up in different runs. Test *failure* is still determined by the existing heuristic. (cherry picked from commit af5f9d6) * gh-83434: Disable XML in regrtest when -R option is used (GH-117232) (cherry picked from commit d52bdfb) --------- (cherry picked from commit 477ef90) Co-authored-by: Victor Stinner <vstinner@python.org> Co-authored-by: Petr Viktorin <encukou@gmail.com>
…ythonGH-115726) Instead of showing a dot for each iteration, show: - '.' for zero (on negative) leaks - number of leaks for 1-9 - 'X' if there are more leaks This allows more rapid iteration: when bisecting, I don't need to wait for the final report to see if the test still leaks. Also, show the full result if there are any non-zero entries. This shows negative entries, for the unfortunate cases where a reference is created and cleaned up in different runs. Test *failure* is still determined by the existing heuristic.
…ythonGH-115726) Instead of showing a dot for each iteration, show: - '.' for zero (on negative) leaks - number of leaks for 1-9 - 'X' if there are more leaks This allows more rapid iteration: when bisecting, I don't need to wait for the final report to see if the test still leaks. Also, show the full result if there are any non-zero entries. This shows negative entries, for the unfortunate cases where a reference is created and cleaned up in different runs. Test *failure* is still determined by the existing heuristic.
Instead of showing a dot for each iteration, show:
Also, separate warmup runs by a colon & space.
This allows more insight into what's going on. It's especially useful for rapid iteration (like bisecting).