File tree Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Expand file tree Collapse file tree 2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -111,8 +111,13 @@ struct exception_def exception_defs[] = {
111
111
AEROSPIKE_ERR_ASYNC_CONNECTION , NULL ),
112
112
EXCEPTION_DEF ("ClientAbortError" , CLIENT_ERR_EXCEPTION_NAME ,
113
113
AEROSPIKE_ERR_CLIENT_ABORT , NULL ),
114
- EXCEPTION_DEF ("TranactionFailed " , CLIENT_ERR_EXCEPTION_NAME ,
114
+ EXCEPTION_DEF ("TransactionFailed " , CLIENT_ERR_EXCEPTION_NAME ,
115
115
AEROSPIKE_TXN_FAILED , NULL ),
116
+ EXCEPTION_DEF ("TransactionAlreadyCommitted" , CLIENT_ERR_EXCEPTION_NAME ,
117
+ AEROSPIKE_TXN_ALREADY_COMMITTED , NULL ),
118
+ EXCEPTION_DEF ("TransactionAlreadyAborted" , CLIENT_ERR_EXCEPTION_NAME ,
119
+ AEROSPIKE_TXN_ALREADY_ABORTED , NULL ),
120
+
116
121
// Server errors
117
122
EXCEPTION_DEF ("InvalidRequest" , SERVER_ERR_EXCEPTION_NAME ,
118
123
AEROSPIKE_ERR_REQUEST_INVALID , NULL ),
Original file line number Diff line number Diff line change @@ -89,8 +89,8 @@ def test_commit_fail(self):
89
89
}
90
90
self .as_connection .put (self .keys [0 ], {self .bin_name : 1 }, policy = policy )
91
91
self .as_connection .abort (mrt )
92
- status = self . as_connection . commit ( mrt )
93
- assert status == aerospike . MRT_COMMIT_ALREADY_ABORTED
92
+ with pytest . raises ( e . TransactionAlreadyAborted ):
93
+ self . as_connection . commit ( mrt )
94
94
95
95
# Test case 10: Issue abort after issung commit. (P1)
96
96
def test_abort_fail (self ):
@@ -100,5 +100,5 @@ def test_abort_fail(self):
100
100
}
101
101
self .as_connection .put (self .keys [0 ], {self .bin_name : 1 }, policy = policy )
102
102
self .as_connection .commit (mrt )
103
- status = self . as_connection . abort ( mrt )
104
- assert status == aerospike . MRT_ABORT_ALREADY_COMMITTED
103
+ with pytest . raises ( e . TransactionAlreadyCommitted ):
104
+ self . as_connection . abort ( mrt )
You can’t perform that action at this time.
0 commit comments