Skip to content
Open
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 @@ -141,28 +141,37 @@ public void startBroker() {
brokerContainer.start();
}
});
String topicName = "persistent://" + DEFAULT_NAMESPACE + "/startBrokerCheck";
Awaitility.await().atMost(120, TimeUnit.SECONDS).ignoreExceptions().until(
() -> {
for (BrokerContainer brokerContainer : pulsarCluster.getBrokers()) {
try (PulsarAdmin admin = PulsarAdmin.builder().serviceHttpUrl(
brokerContainer.getHttpServiceUrl()).build()) {

Awaitility.await()
.atMost(4, TimeUnit.MINUTES)
.ignoreExceptions()
.until(() -> {
for (BrokerContainer broker : pulsarCluster.getBrokers()) {
try (PulsarAdmin admin = PulsarAdmin.builder()
.serviceHttpUrl(broker.getHttpServiceUrl()).build()) {
if (admin.brokers().getActiveBrokers(clusterName).size() != NUM_BROKERS) {
return false;
}
try {
admin.topics().createPartitionedTopic(topicName, 10);
} catch (PulsarAdminException.ConflictException e) {
// expected
}
admin.lookups().lookupPartitionedTopic(topicName);
}
}
return true;
});

String topicName = "persistent://" + DEFAULT_NAMESPACE + "/startBrokerCheck";
for (BrokerContainer broker : pulsarCluster.getBrokers()) {
try (PulsarAdmin admin = PulsarAdmin.builder()
.serviceHttpUrl(broker.getHttpServiceUrl()).build()) {
try {
admin.topics().createPartitionedTopic(topicName, 10);
} catch (PulsarAdminException.ConflictException e) {
// expected
}
);
admin.lookups().lookupPartitionedTopic(topicName);
}
}
}
}


@Test(timeOut = 40 * 1000)
public void testConcurrentLookups() throws Exception {
Expand Down
Loading