snuyanzin commented on code in PR #20991: URL: https://github.com/apache/flink/pull/20991#discussion_r1047270252
########## flink-connectors/flink-connector-kafka/src/test/java/org/apache/flink/streaming/connectors/kafka/FlinkKafkaInternalProducerITCase.java: ########## @@ -102,8 +106,9 @@ public void testHappyPath() throws Exception { deleteTestTopic(topicName); } - @Test(timeout = 30000L) - public void testResumeTransaction() throws Exception { + @Test + @Timeout(30L) Review Comment: time unit should be specified ########## flink-connectors/flink-connector-kafka/src/test/java/org/apache/flink/streaming/connectors/kafka/FlinkKafkaInternalProducerITCase.java: ########## @@ -148,62 +153,78 @@ public void testResumeTransaction() throws Exception { deleteTestTopic(topicName); } - @Test(timeout = 30000L, expected = IllegalStateException.class) - public void testPartitionsForAfterClosed() { + @Test + @Timeout(30L) Review Comment: time unit should be specified ########## flink-connectors/flink-connector-kafka/src/test/java/org/apache/flink/streaming/connectors/kafka/FlinkKafkaInternalProducerITCase.java: ########## @@ -148,62 +153,78 @@ public void testResumeTransaction() throws Exception { deleteTestTopic(topicName); } - @Test(timeout = 30000L, expected = IllegalStateException.class) - public void testPartitionsForAfterClosed() { + @Test + @Timeout(30L) + void testPartitionsForAfterClosed() { FlinkKafkaInternalProducer<String, String> kafkaProducer = new FlinkKafkaInternalProducer<>(extraProperties); kafkaProducer.close(Duration.ofSeconds(5)); - kafkaProducer.partitionsFor("Topic"); + assertThatThrownBy(() -> kafkaProducer.partitionsFor("Topic")) + .isInstanceOf(IllegalStateException.class); } - @Test(timeout = 30000L, expected = IllegalStateException.class) - public void testInitTransactionsAfterClosed() { + @Test + @Timeout(30L) Review Comment: time unit should be specified -- 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