Helper to run operations in a transaction with auto-commit/abort
(name, fn)
| 123 | results = TestResult() |
| 124 | |
| 125 | def run_in_txn(name, fn): |
| 126 | """Helper to run operations in a transaction with auto-commit/abort""" |
| 127 | txn_id = create_transaction(name) |
| 128 | try: |
| 129 | fn(txn_id) |
| 130 | commit_transaction(name, txn_id) |
| 131 | except Exception: |
| 132 | abort_transaction(name, txn_id) |
| 133 | raise |
| 134 | |
| 135 | time.sleep(1) |
| 136 | |
| 137 | # ============== TESTS ============== |
| 138 |
no test coverage detected