Skip to content

Commit b42a125

Browse files
committed
GH-2372: Fix Race in New Test
1 parent 51db0b6 commit b42a125

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3745,7 +3745,7 @@ private static Stream<Arguments> paramsForRecordAllSkipped() {
37453745
Arguments.of(AckMode.BATCH, true));
37463746
}
37473747

3748-
@ParameterizedTest(name = "{index} AckMode.{0} early intercept {1}")
3748+
@ParameterizedTest(name = "{index} testInvokeRecordInterceptorAllSkipped AckMode.{0} early intercept {1}")
37493749
@MethodSource("paramsForRecordAllSkipped")
37503750
@SuppressWarnings({"unchecked", "deprecation"})
37513751
public void testInvokeRecordInterceptorAllSkipped(AckMode ackMode, boolean early) throws Exception {
@@ -3762,7 +3762,7 @@ public void testInvokeRecordInterceptorAllSkipped(AckMode ackMode, boolean early
37623762
Thread.sleep(50);
37633763
return first.getAndSet(false) ? consumerRecords : ConsumerRecords.empty();
37643764
});
3765-
CountDownLatch latch = new CountDownLatch(1);
3765+
CountDownLatch latch = new CountDownLatch(AckMode.RECORD.equals(ackMode) ? 2 : 1);
37663766
willAnswer(inv -> {
37673767
latch.countDown();
37683768
return null;
@@ -3815,7 +3815,7 @@ public ConsumerRecord<Integer, String> intercept(ConsumerRecord<Integer, String>
38153815
container.stop();
38163816
}
38173817

3818-
@ParameterizedTest(name = "{index} early intercept {0}")
3818+
@ParameterizedTest(name = "{index} testInvokeBatchInterceptorAllSkipped early intercept {0}")
38193819
@ValueSource(booleans = { true, false })
38203820
@SuppressWarnings({"unchecked", "deprecation"})
38213821
public void testInvokeBatchInterceptorAllSkipped(boolean early) throws Exception {

0 commit comments

Comments
 (0)