myskov commented on code in PR #5259:
URL: https://github.com/apache/ignite-3/pull/5259#discussion_r1964960152
##########
modules/rest/src/integrationTest/java/org/apache/ignite/internal/rest/transaction/ItTransactionControllerTest.java:
##########
@@ -142,6 +140,34 @@ void shouldReturnProblemIfCancelNonExistingTransaction() {
);
}
+ @Test
+ void shouldCancelTransaction() {
+ Transaction roTx = node(0).transactions().begin(new
TransactionOptions().readOnly(true));
+ Transaction rwTx = node(0).transactions().begin(new
TransactionOptions().readOnly(false));
+
+ TransactionInfo roTransactionInfo = getTransaction(client,
((InternalTransaction) roTx).id());
+ assertThat(roTransactionInfo, notNullValue());
+
+ cancelTransaction(client, roTransactionInfo.id());
+
+ assertThrowsProblem(
+ () -> getTransaction(client, roTransactionInfo.id()),
+ NOT_FOUND,
+ isProblem().withDetail("Transaction not found [transactionId="
+ roTransactionInfo.id() + "]")
+ );
+
+ TransactionInfo rwTransactionInfo = getTransaction(client,
((InternalTransaction) rwTx).id());
Review Comment:
looks like it's the same code written twice, with two assertions and 2
arguments. Shouldn't it be parametrized test? or two tests with some shared
method?
##########
modules/rest/src/main/java/org/apache/ignite/internal/rest/transaction/TransactionController.java:
##########
@@ -78,7 +78,6 @@ public CompletableFuture<TransactionInfo> transaction(UUID
transactionId) {
@Override
public CompletableFuture<Void> cancelTransaction(UUID transactionId) {
Review Comment:
There's KILL query in SQL and InternalTransaction.kill() to abort
transaction. Shouldn't we use term "kill" instead of "cancel" then?
--
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]