This is an automated email from the ASF dual-hosted git repository.
david-streamlio pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pulsar-connectors.git
The following commit(s) were added to refs/heads/master by this push:
new 518742a3 [fix][test] Wait for the public tenant before creating the
test namespace (#84)
518742a3 is described below
commit 518742a3fe7507d0dcde7495063dc603a885c93c
Author: David Kjerrumgaard <[email protected]>
AuthorDate: Fri Jul 10 07:37:24 2026 -0700
[fix][test] Wait for the public tenant before creating the test namespace
(#84)
PulsarSchemaHistoryTest.setup() created public/my-ns as soon as the
container reported ready, but the broker creates the public tenant
asynchronously during bootstrap. When the container's wait strategy
returned first, createNamespace failed with 'Tenant does not exist'
(HTTP 404), taking down every test in the class and failing unrelated
pull requests.
Poll for the tenant before creating the namespace.
---
.../apache/pulsar/io/debezium/PulsarSchemaHistoryTest.java | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git
a/debezium/core/src/test/java/org/apache/pulsar/io/debezium/PulsarSchemaHistoryTest.java
b/debezium/core/src/test/java/org/apache/pulsar/io/debezium/PulsarSchemaHistoryTest.java
index 46dbbd92..0856cc1e 100644
---
a/debezium/core/src/test/java/org/apache/pulsar/io/debezium/PulsarSchemaHistoryTest.java
+++
b/debezium/core/src/test/java/org/apache/pulsar/io/debezium/PulsarSchemaHistoryTest.java
@@ -32,11 +32,13 @@ import io.debezium.text.ParsingException;
import io.debezium.util.Collect;
import java.util.List;
import java.util.Map;
+import java.util.concurrent.TimeUnit;
import org.apache.pulsar.client.admin.PulsarAdmin;
import org.apache.pulsar.client.api.Producer;
import org.apache.pulsar.client.api.PulsarClient;
import org.apache.pulsar.client.api.Reader;
import org.apache.pulsar.client.api.Schema;
+import org.awaitility.Awaitility;
import org.testcontainers.containers.PulsarContainer;
import org.testcontainers.utility.DockerImageName;
import org.testng.annotations.AfterMethod;
@@ -72,6 +74,16 @@ public class PulsarSchemaHistoryTest {
.serviceHttpUrl(pulsarContainer.getHttpServiceUrl())
.build();
+ // The broker creates the "public" tenant asynchronously during
bootstrap, and the
+ // container's wait strategy can return before that finishes. Creating
the namespace
+ // immediately then fails with "Tenant does not exist" (HTTP 404).
Seen in CI:
+ // https://github.com/apache/pulsar-connectors/actions/runs/29055562433
+ Awaitility.await()
+ .atMost(60, TimeUnit.SECONDS)
+ .pollInterval(250, TimeUnit.MILLISECONDS)
+ .ignoreExceptions()
+ .until(() -> admin.tenants().getTenants().contains("public"));
+
// Create namespace used by tests
admin.namespaces().createNamespace("public/my-ns");