Author: Armin Rigo <[email protected]>
Branch: 
Changeset: r1092:d8fe314589b8
Date: 2014-03-25 10:01 +0100
http://bitbucket.org/pypy/stmgc/changeset/d8fe314589b8/

Log:    Improve the test so that it crashes more reliably (this includes
        older revisions now)

diff --git a/c7/test/test_weakref.py b/c7/test/test_weakref.py
--- a/c7/test/test_weakref.py
+++ b/c7/test/test_weakref.py
@@ -340,20 +340,23 @@
         assert stm_get_weakref(lp1) == lp0
 
     def test_weakref_bug2(self):
-        self.start_transaction()
-        lp0 = stm_allocate(16)
-        self.push_root(lp0)
-        self.commit_transaction()
+        def make_wr():
+            self.start_transaction()
+            lp0 = stm_allocate(16)
+            self.push_root(lp0)
+            self.commit_transaction()
+            #
+            self.start_transaction()
+            lp0 = self.pop_root()
+            self.push_root(lp0)
+            stm_write(lp0)    # privatize page
+            lp1 = stm_allocate_weakref(lp0)    # young object
+            self.push_root(lp1)
+            stm_minor_collect()
+            lp1 = self.pop_root()       # overflow object
+            self.push_root(lp1)
         #
-        self.start_transaction()
-        lp0 = self.pop_root()
-        self.push_root(lp0)
-        stm_write(lp0)    # privatize page
-        lp1 = stm_allocate_weakref(lp0)    # young object
-        self.push_root(lp1)
-        stm_minor_collect()
-        lp1 = self.pop_root()       # overflow object
-        self.push_root(lp1)
-        #
+        make_wr()
         self.switch(1)
+        make_wr()
         stm_major_collect()
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to