[pypy-commit] stmgc c7-refactor: add explicit aborts to test_random

Remi Meier noreply at buildbot.pypy.org
Wed Feb 19 15:53:45 CET 2014


Author: Remi Meier
Branch: c7-refactor
Changeset: r785:39016b9afc2a
Date: 2014-02-19 15:53 +0100
http://bitbucket.org/pypy/stmgc/changeset/39016b9afc2a/

Log:	add explicit aborts to test_random

diff --git a/c7/test/test_random.py b/c7/test/test_random.py
--- a/c7/test/test_random.py
+++ b/c7/test/test_random.py
@@ -245,6 +245,14 @@
             ex.do('py.test.raises(Conflict, self.commit_transaction)')
         else:
             ex.do('self.commit_transaction()')
+
+class OpAbortTransaction(Operation):
+    def do(self, ex, global_state, thread_state):
+        thread_state.transaction_state.set_must_abort()
+        thread_state.abort_transaction()
+        ex.do('self.abort_transaction()')
+
+            
             
 class OpAllocate(Operation):
     def do(self, ex, global_state, thread_state):
@@ -384,11 +392,15 @@
                 OpWrite,
                 OpWrite,
                 OpWrite,
+                OpWrite,
+                OpRead,
+                OpRead,
                 OpRead,
                 OpRead,
                 OpRead,
                 OpRead,
                 OpCommitTransaction,
+                OpAbortTransaction,
                 OpForgetRoot,
             ])
             action().do(ex, global_state, curr_thread)


More information about the pypy-commit mailing list