JimmyZZZ commented on code in PR #107: URL: https://github.com/apache/flink-connector-kafka/pull/107#discussion_r1670125675
########## flink-connector-kafka/src/test/java/org/apache/flink/connector/kafka/sink/KafkaWriterFaultToleranceITCase.java: ########## @@ -0,0 +1,170 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache License, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +package org.apache.flink.connector.kafka.sink; + +import org.apache.flink.connector.base.DeliveryGuarantee; +import org.apache.flink.metrics.groups.SinkWriterMetricGroup; +import org.apache.flink.util.TestLoggerExtension; + +import org.apache.kafka.common.errors.TimeoutException; +import org.junit.jupiter.api.AfterAll; +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; +import org.junit.jupiter.api.TestInfo; +import org.junit.jupiter.api.extension.ExtendWith; + +import java.util.Properties; + +import static org.assertj.core.api.AssertionsForClassTypes.assertThatCode; + +/** Tests for the standalone KafkaWriter in case of fault tolerance. */ +@ExtendWith(TestLoggerExtension.class) +public class KafkaWriterFaultToleranceITCase extends KafkaWriterTestBase { + private static final String INIT_KAFKA_RETRIES = "1"; + private static final String INIT_KAFKA_REQUEST_TIMEOUT_MS = "2000"; + private static final String INIT_KAFKA_MAX_BLOCK_MS = "3000"; + private static final String INIT_KAFKA_DELIVERY_TIMEOUT_MS = "4000"; Review Comment: > Tests look good. I'm wondering if we can/need to tweak these numbers to make the test hopefully not flaky. > > We have to make good tradeoffs here: > > * The overall test shouldn't take too long and we are relying on timeouts here. > * Timeouts shouldn't be too small to compensate for infra hiccups. > * Retries should be non-zero. > > On first glance, the values all look good in that regard. > > However, now at a second thought: do we ever want to have a successful request in this test? Maybe we could set really low timeouts and retry = 0 and provoke the failures even quicker? Yes, the purpose is to make timeout exception, retry=0 or 1 has no difference here. Have modified retry = 0 now. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@flink.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org