8000 gh-115720: Show number of leaks in huntrleaks progress reports by encukou · Pull Request #115726 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-115720: Show number of leaks in huntrleaks progress reports #115726

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 3 commits into from
Feb 27, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Show full result if it's not all zeros
  • Loading branch information
encukou committed Feb 21, 2024
commit f2a10a161301502e4718410afbcb7b9f077d5e61
20 changes: 13 additions & 7 deletions Lib/test/libregrtest/refleak.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def get_pooled_int(value):

if not quiet:
print("beginning", repcount, "repetitions. Showing number of leaks "
"(. for zero, X for 10 or more)",
"(. for 0 or less, X for 10 or more)",
file=sys.stderr)
numbers = ("1234567890"*(repcount//10 + 1))[:repcount]
numbers = numbers[:warmups] + ':' + numbers[warmups:]
Expand Down Expand Up @@ -175,14 +175,20 @@ def check_fd_deltas(deltas):
]:
# ignore warmup runs
deltas = deltas[warmups:]
if checker(deltas):
failing = checker(deltas)
suspicious = any(deltas)
if failing or suspicious:
msg = '%s leaked %s %s, sum=%s' % (
test_name, deltas, item_name, sum(deltas))
print(msg, file=sys.stderr, flush=True)
with open(filename, "a", encoding="utf-8") as refrep:
print(msg, file=refrep)
refrep.flush()
failed = True
print(msg, end='', file=sys.stderr)
if failing:
print(file=sys.stderr, flush=True)
with open(filename, "a", encoding="utf-8") as refrep:
print(msg, file=refrep)
refrep.flush()
failed = True
else:
print(' (this is fine)', file=sys.stderr, flush=True)
return (failed, results)


Expand Down
0