From fd3e4ffb43563834f94a169882b1e400646cd0d8 Mon Sep 17 00:00:00 2001 From: chickenchickenlove Date: Mon, 7 Oct 2024 21:48:49 +0900 Subject: [PATCH] Fixes flaky integration tests. --- .../DeliveryAttemptAwareRetryListenerIntegrationTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spring-kafka/src/test/java/org/springframework/kafka/listener/DeliveryAttemptAwareRetryListenerIntegrationTest.java b/spring-kafka/src/test/java/org/springframework/kafka/listener/DeliveryAttemptAwareRetryListenerIntegrationTest.java index 8b1268c71f..c9712478d3 100644 --- a/spring-kafka/src/test/java/org/springframework/kafka/listener/DeliveryAttemptAwareRetryListenerIntegrationTest.java +++ b/spring-kafka/src/test/java/org/springframework/kafka/listener/DeliveryAttemptAwareRetryListenerIntegrationTest.java @@ -157,13 +157,13 @@ static class TestTopicListener0 { containerFactory = MAIN_TOPIC_CONTAINER_FACTORY0, batch = "true") public void listen(List> records) { - latch0.countDown(); for (ConsumerRecord record : records) { Iterable
headers = record.headers().headers(KafkaHeaders.DELIVERY_ATTEMPT); for (Header header : headers) { receivedHeaders.add(header); } } + latch0.countDown(); throw new RuntimeException("Failed."); } } @@ -176,13 +176,13 @@ static class TestTopicListener1 { containerFactory = MAIN_TOPIC_CONTAINER_FACTORY1, batch = "true") public void listen(List> records) { - latch1.countDown(); for (ConsumerRecord record : records) { Iterable
headers = record.headers().headers(KafkaHeaders.DELIVERY_ATTEMPT); for (Header header : headers) { receivedHeaders.add(header); } } + latch1.countDown(); throw new RuntimeException("Failed."); } }