Skip to content

Commit d062327

Browse files
committed
Fix bug at TransactionalContainerTests.testBatchListenerRecoverAfterRollbackProcessorCrash
* change CountDownLatch to 2, record foo and bar in the same throw exception, baz and qux count down latch.
1 parent cd4341c commit d062327

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

spring-kafka/src/test/java/org/springframework/kafka/listener/TransactionalContainerTests.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@
112112
@EmbeddedKafka(topics = { TransactionalContainerTests.topic1, TransactionalContainerTests.topic2,
113113
TransactionalContainerTests.topic3, TransactionalContainerTests.topic3DLT, TransactionalContainerTests.topic4,
114114
TransactionalContainerTests.topic5, TransactionalContainerTests.topic6, TransactionalContainerTests.topic7,
115-
TransactionalContainerTests.topic8, TransactionalContainerTests.topic8DLT },
115+
TransactionalContainerTests.topic8, TransactionalContainerTests.topic8DLT, TransactionalContainerTests.topic9},
116116
brokerProperties = { "transaction.state.log.replication.factor=1", "transaction.state.log.min.isr=1" })
117117
public class TransactionalContainerTests {
118118

@@ -957,7 +957,7 @@ public void testBatchListenerRecoverAfterRollbackProcessorCrash() throws Excepti
957957
DefaultKafkaProducerFactory<Object, Object> pf = new DefaultKafkaProducerFactory<>(senderProps);
958958
pf.setTransactionIdPrefix("batchListener.noRetries.");
959959
final KafkaTemplate<Object, Object> template = new KafkaTemplate<>(pf);
960-
final CountDownLatch latch = new CountDownLatch(1);
960+
final CountDownLatch latch = new CountDownLatch(2);
961961
AtomicReference<String> data = new AtomicReference<>();
962962
containerProps.setMessageListener((BatchMessageListener<Integer, String>) recordList -> {
963963
for (ConsumerRecord<Integer, String> record : recordList) {

0 commit comments

Comments
 (0)