Skip to content
Merged
Changes from all commits
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
bpo-36560: regrtest: don't collect the GC twice
dash_R() function of libregrtest doesn't call support.gc_collect()
directly anymore: it's already called by dash_R_cleanup().

Call dash_R_cleanup() before starting the loop.
  • Loading branch information
vstinner committed Apr 9, 2019
commit 259f5f7c773887081280b8ad1ba5c4bd2677ac02
6 changes: 4 additions & 2 deletions Lib/test/libregrtest/refleak.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,14 @@ def get_pooled_int(value):
print(("1234567890"*(repcount//10 + 1))[:repcount], file=sys.stderr,
flush=True)

dash_R_cleanup(fs, ps, pic, zdc, abcs)

for i in rep_range:
test_func()
dash_R_cleanup(fs, ps, pic, zdc, abcs)

# Collect cyclic trash and read memory statistics immediately after.
support.gc_collect()
# dash_R_cleanup() ends with collecting cyclic trash:
# read memory statistics immediately after.
alloc_after = getallocatedblocks()
rc_after = gettotalrefcount()
fd_after = fd_count()
Expand Down