From 9dfdf79a0ee1e45bbdf79b233590c79fed3cd8c4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20GREFFIER?= Date: Mon, 5 Aug 2024 17:22:13 +0200 Subject: [PATCH] Fix task state check in connector integration tests (#426) --- .../ns4kafka/integration/ConnectIntegrationTest.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/test/java/com/michelin/ns4kafka/integration/ConnectIntegrationTest.java b/src/test/java/com/michelin/ns4kafka/integration/ConnectIntegrationTest.java index 1c0af1b3..7f930f4d 100644 --- a/src/test/java/com/michelin/ns4kafka/integration/ConnectIntegrationTest.java +++ b/src/test/java/com/michelin/ns4kafka/integration/ConnectIntegrationTest.java @@ -412,7 +412,8 @@ void shouldRestartConnector() throws InterruptedException { .spec(Topic.TopicSpec.builder() .partitions(3) .replicationFactor(1) - .configs(Map.of("cleanup.policy", "delete", + .configs(Map.of( + "cleanup.policy", "delete", "min.insync.replicas", "1", "retention.ms", "60000")) .build()) @@ -449,7 +450,6 @@ void shouldRestartConnector() throws InterruptedException { .body(connector)); forceConnectorSynchronization(); - waitForConnectorAndTasksToBeInState("ns1-co1", Connector.TaskState.RUNNING); ChangeConnectorState restartState = ChangeConnectorState.builder() .metadata(Metadata.builder() @@ -469,6 +469,8 @@ void shouldRestartConnector() throws InterruptedException { assertEquals(HttpStatus.OK, restartResponse.status()); + waitForConnectorAndTasksToBeInState("ns1-co1", Connector.TaskState.RUNNING); + ConnectorStateInfo actual = connectClient .toBlocking() .retrieve(HttpRequest.GET("/connectors/ns1-co1/status"), ConnectorStateInfo.class);