sanpwc commented on code in PR #3604:
URL: https://github.com/apache/ignite-3/pull/3604#discussion_r1566851827


##########
modules/table/src/test/java/org/apache/ignite/internal/table/distributed/replication/PartitionReplicaListenerTest.java:
##########
@@ -704,6 +705,30 @@ public void testTxStateReplicaRequestCommitState() throws 
Exception {
         assertTrue(readTimestamp.compareTo(txMeta.commitTimestamp()) > 0);
     }
 
+    @Test
+    public void testExecuteRequestOnFinishedTx() {

Review Comment:
   - I'd rather convert it to parametrized test with current state as a 
parameter [COMMITTED, ABORTED, FIINISHING].
   - I'd also iterate through all possible RequestType options.



##########
modules/table/src/test/java/org/apache/ignite/internal/table/distributed/replication/PartitionReplicaListenerTest.java:
##########
@@ -704,6 +705,30 @@ public void testTxStateReplicaRequestCommitState() throws 
Exception {
         assertTrue(readTimestamp.compareTo(txMeta.commitTimestamp()) > 0);
     }
 
+    @Test
+    public void testExecuteRequestOnFinishedTx() {
+        UUID txId = newTxId();
+
+        txStateStorage.put(txId, new TxMeta(ABORTED, singletonList(grpId), 
null));
+        txManager.updateTxMeta(txId, old -> new TxStateMeta(ABORTED, null, 
null, null));
+
+        BinaryRow testRow = binaryRow(0);
+
+        assertThat(doSingleRowRequest(txId, testRow, RequestType.RW_INSERT), 
willThrowFast(TransactionException.class));
+    }

Review Comment:
   BTW I believe that it's fine to have finished even it's finishing within 
given context, what do you think?



##########
modules/table/src/test/java/org/apache/ignite/internal/table/distributed/replication/PartitionReplicaListenerTest.java:
##########
@@ -704,6 +705,30 @@ public void testTxStateReplicaRequestCommitState() throws 
Exception {
         assertTrue(readTimestamp.compareTo(txMeta.commitTimestamp()) > 0);
     }
 
+    @Test
+    public void testExecuteRequestOnFinishedTx() {
+        UUID txId = newTxId();
+
+        txStateStorage.put(txId, new TxMeta(ABORTED, singletonList(grpId), 
null));
+        txManager.updateTxMeta(txId, old -> new TxStateMeta(ABORTED, null, 
null, null));
+
+        BinaryRow testRow = binaryRow(0);
+
+        assertThat(doSingleRowRequest(txId, testRow, RequestType.RW_INSERT), 
willThrowFast(TransactionException.class));

Review Comment:
   I'd also check that the message contains "Transaction is already finished".



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to