KAFKA-8817: Remove timeout for the whole test (#7313)

I bumped into this flaky test while working on another PR. It's a bit different from the reported PR, where it actually timed out at parsing localhost:port already. I think what we should really test is that the closing call can complete, so I removed the whole test timeout and add the timeout for the shutdown latch instead.

Reviewers: Jason Gustafson <jason@confluent.io>, cpettitt-confluent <53191309+cpettitt-confluent@users.noreply.github.com>
This commit is contained in:
Guozhang Wang 2019-09-10 19:01:10 -07:00 committed by GitHub
parent 7012fa3262
commit a043edb559
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 6 deletions

View File

@ -809,7 +809,7 @@ public class KafkaProducerTest {
assertThrows(IllegalStateException.class, producer::initTransactions);
}
@Test(timeout = 5000)
@Test
public void testCloseIsForcedOnPendingFindCoordinator() throws InterruptedException {
Map<String, Object> configs = new HashMap<>();
configs.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, "localhost:9000");
@ -834,10 +834,10 @@ public class KafkaProducerTest {
client.waitForRequests(1, 2000);
producer.close(Duration.ofMillis(1000));
assertionDoneLatch.await();
assertionDoneLatch.await(5000, TimeUnit.MILLISECONDS);
}
@Test(timeout = 5000)
@Test
public void testCloseIsForcedOnPendingInitProducerId() throws InterruptedException {
Map<String, Object> configs = new HashMap<>();
configs.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, "localhost:9000");
@ -863,10 +863,10 @@ public class KafkaProducerTest {
client.waitForRequests(1, 2000);
producer.close(Duration.ofMillis(1000));
assertionDoneLatch.await();
assertionDoneLatch.await(5000, TimeUnit.MILLISECONDS);
}
@Test(timeout = 5000)
@Test
public void testCloseIsForcedOnPendingAddOffsetRequest() throws InterruptedException {
Map<String, Object> configs = new HashMap<>();
configs.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, "localhost:9000");
@ -892,7 +892,7 @@ public class KafkaProducerTest {
client.waitForRequests(1, 2000);
producer.close(Duration.ofMillis(1000));
assertionDoneLatch.await();
assertionDoneLatch.await(5000, TimeUnit.MILLISECONDS);
}
private ProducerMetadata newMetadata(long refreshBackoffMs, long expirationMs) {