]> granicus.if.org Git - python/commitdiff
bpo-36560: regrtest: don't collect the GC twice (GH-12747)
authorVictor Stinner <vstinner@redhat.com>
Tue, 9 Apr 2019 16:26:16 +0000 (18:26 +0200)
committerGitHub <noreply@github.com>
Tue, 9 Apr 2019 16:26:16 +0000 (18:26 +0200)
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.

Lib/test/libregrtest/refleak.py

index 0bb8a0a2bf083cf4ed5d239888ec7d930631ba26..235d6bfd3af621d60e4ad21e1b1058b02ab3dbe0 100644 (file)
@@ -82,12 +82,14 @@ def dash_R(ns, the_module, test_name, test_func):
         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()