mirror of https://github.com/apache/kafka.git
KAFKA-12557: Fix hanging KafkaAdminClientTest (#10404)
Fix a hanging test in KafkaAdminClientTest by forcing the admin client to shut down whether or not there are pending requests once the test harness enters shutdown. Reviewers: Ismael Juma <ijuma@apache.org>, Guozhang Wang <guozhang@apache.org>
This commit is contained in:
parent
0018c3c089
commit
d02ad2c0e1
|
@ -23,6 +23,7 @@ import org.apache.kafka.common.Node;
|
||||||
import org.apache.kafka.common.utils.LogContext;
|
import org.apache.kafka.common.utils.LogContext;
|
||||||
import org.apache.kafka.common.utils.Time;
|
import org.apache.kafka.common.utils.Time;
|
||||||
|
|
||||||
|
import java.time.Duration;
|
||||||
import java.util.Collections;
|
import java.util.Collections;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -113,7 +114,10 @@ public class AdminClientUnitTestEnv implements AutoCloseable {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void close() {
|
public void close() {
|
||||||
this.adminClient.close();
|
// tell the admin client to close now
|
||||||
|
this.adminClient.close(Duration.ZERO);
|
||||||
|
// block for up to a minute until the internal threads shut down.
|
||||||
|
this.adminClient.close(Duration.ofMinutes(1));
|
||||||
}
|
}
|
||||||
|
|
||||||
static Map<String, Object> clientConfigs(String... overrides) {
|
static Map<String, Object> clientConfigs(String... overrides) {
|
||||||
|
|
Loading…
Reference in New Issue