Skip to content

Commit d74a7bd

Browse files
committed
[FLINK-37611] Deflake KafkaWriterFaultToleranceITCase.testWriteExceptionWhenKafkaUnavailable
Apparently, with newer kafka-clients library, we may also see TimeoutExceptions in some occasions.
1 parent 765b1e7 commit d74a7bd

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

flink-connector-kafka/src/test/java/org/apache/flink/connector/kafka/sink/KafkaWriterFaultToleranceITCase.java

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,11 @@ void testWriteExceptionWhenKafkaUnavailable() throws Exception {
6767
try {
6868
writer.getCurrentProducer().flush();
6969
assertThatCode(() -> writer.write(1, SINK_WRITER_CONTEXT))
70-
.hasRootCauseExactlyInstanceOf(NetworkException.class);
70+
.rootCause()
71+
.matches(
72+
e ->
73+
e instanceof NetworkException
74+
|| e instanceof TimeoutException);
7175
} finally {
7276
KAFKA_CONTAINER.start();
7377
}

0 commit comments

Comments
 (0)