Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add KRaft to ITs #962

Merged
merged 6 commits into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from 5 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
2 changes: 2 additions & 0 deletions .azure/build-pipeline.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ stages:
displayName: Java build
jobs:
- template: 'templates/jobs/build_java.yaml'
variables:
STRIMZI_TEST_CONTAINER_LOGGING_ENABLED: false
- stage: docs_build
displayName: Docs build
dependsOn: []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ public class ConsumerGeneratedNameIT {
static {
if ("FALSE".equals(KAFKA_EXTERNAL_ENV)) {
kafkaContainer = new StrimziKafkaContainer()
.withKraft()
.waitForRunning();
kafkaContainer.start();
kafkaUri = kafkaContainer.getBootstrapServers();
Expand Down
1 change: 1 addition & 0 deletions src/test/java/io/strimzi/kafka/bridge/http/HttpCorsIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ public class HttpCorsIT {
static {
if ("FALSE".equals(KAFKA_EXTERNAL_ENV)) {
kafkaContainer = new StrimziKafkaContainer()
.withKraft()
.waitForRunning();
kafkaContainer.start();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ public abstract class HttpBridgeITAbstract {
static {
if ("FALSE".equals(KAFKA_EXTERNAL_ENV)) {
kafkaContainer = new StrimziKafkaContainer()
.withKraft()
.waitForRunning();
kafkaContainer.start();

Expand Down Expand Up @@ -161,7 +162,23 @@ void setUpEach() {
void cleanUp() throws InterruptedException, ExecutionException {
Collection<String> topics = adminClientFacade.listTopic();
LOGGER.info("Kafka still contains {}", topics);
adminClientFacade.deleteTopics(topics);

if (!topics.isEmpty()) {
try {
adminClientFacade.deleteTopics(topics);
} catch (ExecutionException executionException) {
if (executionException.getCause() instanceof org.apache.kafka.common.errors.UnknownTopicOrPartitionException) {
LOGGER.warn("Some topics not found (already deleted). Ignoring ...");
} else {
throw executionException;
}
}

Collection<String> remainingTopics = adminClientFacade.listTopic();
if (!remainingTopics.isEmpty()) {
LOGGER.error("Topics still present after cleanup: {}", remainingTopics);
}
}
}

protected String generateRandomConsumerGroupName() {
Expand Down
Loading