Author: Antonio Cuni <[email protected]>
Branch: gc-hooks
Changeset: r94190:2492c826dee0
Date: 2018-03-30 18:26 +0200
http://bitbucket.org/pypy/pypy/changeset/2492c826dee0/

Log:    reset the counters at the beginning of this test, else we count also
        the colletions occurred in the previous tests

diff --git a/rpython/memory/test/test_transformed_gc.py 
b/rpython/memory/test/test_transformed_gc.py
--- a/rpython/memory/test/test_transformed_gc.py
+++ b/rpython/memory/test/test_transformed_gc.py
@@ -1397,6 +1397,11 @@
     steps = 0
     collects = 0
 
+    def reset(self):
+        self.minors = 0
+        self.steps = 0
+        self.collects = 0
+
     @staticmethod
     def fix_annotation():
         # this is needed to "fix" the annotation of GcHooksStats early, and
@@ -1484,6 +1489,7 @@
         gchooks = cls.gchooks
         def f():
             GC_HOOKS_STATS.fix_annotation()
+            GC_HOOKS_STATS.reset()
             # trigger two major collections
             llop.gc__collect(lltype.Void)
             llop.gc__collect(lltype.Void)
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to