Skip to content

Commit bb44478

Browse files
authored
bpo-36560: regrtest: don't collect the GC twice (GH-12747)
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.
1 parent e65f01f commit bb44478

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Lib/test/libregrtest/refleak.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,12 +82,14 @@ def get_pooled_int(value):
8282
print(("1234567890"*(repcount//10 + 1))[:repcount], file=sys.stderr,
8383
flush=True)
8484

85+
dash_R_cleanup(fs, ps, pic, zdc, abcs)
86+
8587
for i in rep_range:
8688
test_func()
8789
dash_R_cleanup(fs, ps, pic, zdc, abcs)
8890

89-
# Collect cyclic trash and read memory statistics immediately after.
90-
support.gc_collect()
91+
# dash_R_cleanup() ends with collecting cyclic trash:
92+
# read memory statistics immediately after.
9193
alloc_after = getallocatedblocks()
9294
rc_after = gettotalrefcount()
9395
fd_after = fd_count()

0 commit comments

Comments
 (0)