Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork34.1k
Comments
gh-115720: Show number of leaks in huntrleaks progress reports#115726
gh-115720: Show number of leaks in huntrleaks progress reports#115726encukou merged 3 commits intopython:mainfrom
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 leaksThis allows more rapid iteration: I don't need to wait for the finalreport 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)foriinrange(1,10)]+ ['X']defget_symbol(value):returnsymbols[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] |
vstinner commentedFeb 20, 2024
The problem is how to display negative numbers:#115725 |
encukou commentedFeb 20, 2024
Ah! Good point. Tomorrow I'll update this to make cases like |
SIMBA111111 commentedFeb 20, 2024
veru good |
vstinner left a comment• edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
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 changecheck_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
encukou commentedFeb 21, 2024
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. |
bedevere-bot commentedFeb 22, 2024
encukou commentedFeb 26, 2024
@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 leaksThis allows more rapid iteration: when bisecting, I don't needto 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 wherea 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 leaksThis allows more rapid iteration: when bisecting, I don't needto 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 wherea 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 leaksThis allows more rapid iteration: when bisecting, I don't needto 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 wherea reference is created and cleaned up in different runs.Test *failure* is still determined by the existing heuristic.(cherry picked from commitaf5f9d6)
…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 leaksThis allows more rapid iteration: when bisecting, I don't needto 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 wherea reference is created and cleaned up in different runs.Test *failure* is still determined by the existing heuristic.(cherry picked from commitaf5f9d6)
…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 commit1e5719a)*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 leaksThis allows more rapid iteration: when bisecting, I don't needto 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 wherea reference is created and cleaned up in different runs.Test *failure* is still determined by the existing heuristic.(cherry picked from commitaf5f9d6)*gh-83434: Disable XML in regrtest when -R option is used (#117232)(cherry picked from commitd52bdfb)---------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 commit1e5719a)*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 leaksThis allows more rapid iteration: when bisecting, I don't needto 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 wherea reference is created and cleaned up in different runs.Test *failure* is still determined by the existing heuristic.(cherry picked from commitaf5f9d6)*pythongh-83434: Disable XML in regrtest when -R option is used (pythonGH-117232)(cherry picked from commitd52bdfb)---------(cherry picked from commit477ef90)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 commit1e5719a)*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 leaksThis allows more rapid iteration: when bisecting, I don't needto 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 wherea reference is created and cleaned up in different runs.Test *failure* is still determined by the existing heuristic.(cherry picked from commitaf5f9d6)*gh-83434: Disable XML in regrtest when -R option is used (GH-117232)(cherry picked from commitd52bdfb)---------(cherry picked from commit477ef90)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 leaksThis allows more rapid iteration: when bisecting, I don't needto 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 wherea 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 leaksThis allows more rapid iteration: when bisecting, I don't needto 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 wherea reference is created and cleaned up in different runs.Test *failure* is still determined by the existing heuristic.
Uh oh!
There was an error while loading.Please reload this page.
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).