Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,11 @@
import org.apache.kafka.connect.runtime.distributed.ConnectProtocolCompatibility;
import org.apache.kafka.connect.storage.StringConverter;
import org.apache.kafka.connect.util.clusters.EmbeddedConnectCluster;
import org.apache.kafka.connect.util.clusters.WorkerHandle;
import org.apache.kafka.test.IntegrationTest;
import org.apache.kafka.test.TestUtils;
import org.junit.After;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.junit.experimental.categories.Category;
import org.slf4j.Logger;
Expand Down Expand Up @@ -87,9 +88,6 @@ public void close() {
}

@Test
@Ignore
// TODO: This test runs fine locally but fails on Jenkins. Ignoring for now, should revisit when
// possible.
public void ensureInternalEndpointIsSecured() throws Throwable {
final String connectorTasksEndpoint = connect.endpointForResource(String.format(
"connectors/%s/tasks",
Expand All @@ -100,6 +98,10 @@ public void ensureInternalEndpointIsSecured() throws Throwable {
invalidSignatureHeaders.put(SIGNATURE_HEADER, "S2Fma2Flc3F1ZQ==");
invalidSignatureHeaders.put(SIGNATURE_ALGORITHM_HEADER, "HmacSHA256");

TestUtils.waitForCondition(
() -> connect.workers().stream().allMatch(WorkerHandle::isRunning),
30000L, "Timed out waiting for workers to start");

// We haven't created the connector yet, but this should still return a 400 instead of a 404
// if the endpoint is secured
log.info(
Expand All @@ -118,10 +120,9 @@ public void ensureInternalEndpointIsSecured() throws Throwable {
+ "expecting 403 error response",
connectorTasksEndpoint
);
assertEquals(
FORBIDDEN.getStatusCode(),
connect.requestPost(connectorTasksEndpoint, "[]", invalidSignatureHeaders).getStatus()
);
TestUtils.waitForCondition(
() -> connect.requestPost(connectorTasksEndpoint, "[]", invalidSignatureHeaders).getStatus() == FORBIDDEN.getStatusCode(),
30000L, "Timed out waiting for workers to start");

// Create the connector now
// setup up props for the sink connector
Expand Down