Skip to content

Commit b93f62e

Browse files
committed
Update test to include check for transaction APIs
1 parent 6c26595 commit b93f62e

File tree

1 file changed

+10
-0
lines changed
  • clients/src/test/java/org/apache/kafka/clients/producer/internals

1 file changed

+10
-0
lines changed

clients/src/test/java/org/apache/kafka/clients/producer/internals/SenderTest.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3042,6 +3042,16 @@ public void testSenderShouldTransitionToAbortableAfterRetriesExhausted() throws
30423042
// Sender will try to send and fail with TransactionAbortableException instead of COORDINATOR_LOAD_IN_PROGRESS, because we're in abortable state
30433043
sender.runOnce();
30443044
assertFutureFailure(future2, TransactionAbortableException.class);
3045+
3046+
3047+
// Verify transaction API requests also fail with TransactionAbortableException
3048+
try {
3049+
txnManager.beginCommit();
3050+
fail("Expected beginCommit() to fail with TransactionAbortableException when in abortable error state");
3051+
} catch (KafkaException e) {
3052+
assertEquals(TransactionAbortableException.class, e.getCause().getClass());
3053+
}
3054+
30453055
}
30463056

30473057
@Test

0 commit comments

Comments
 (0)