Skip to content
Open
Show file tree
Hide file tree
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 @@ -396,6 +396,25 @@ public void shutDownBroker(int brokerId) {
timeout,
String.format("Broker %s did not shutdown properly.", brokerId)
);

// Wait until describeLogDirs fails
waitUntil(
() -> {
try {
_adminClient.describeLogDirs(Collections.singletonList(brokerId))
.allDescriptions()
.get(5, TimeUnit.SECONDS);
return false;
} catch (InterruptedException ie) {
throw new RuntimeException(ie);
} catch (Exception e) {
return true;
}
},
result -> result,
timeout,
String.format("Broker %s did not fully shut down (logDirs RPC still succeeds).", brokerId)
);
}

public static class BrokerWaitStrategy extends AbstractWaitStrategy {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -869,9 +869,17 @@ private void executeAndVerifyProposals(AdminClient adminClient,
topic.partitions().get(tp.partition()).replicas().stream().anyMatch(rep -> r.brokerId().equals(rep.id())));
}
}
assertEquals("The leader should have moved for " + tp,
proposal.newLeader().brokerId().intValue(), topic.partitions().get(tp.partition()).leader().id());

// Wait for leader movement
//TopicDescription topicAfterLeaderMove = _cluster.waitForTopicMetadata(tp.topic(), Duration.ofSeconds(60),
// topicDescription -> topicDescription.partitions().get(tp.partition()).leader().id()
// == proposal.newLeader().brokerId());
assertEquals("The leader should have moved for " + tp
+ " proposal.newReplicas: " + proposal.newReplicas()
+ " proposal.old.replicas " + proposal.oldReplicas()
+ " topic.leader " + topic.partitions().get(tp.partition()).leader().id(),
proposal.newLeader().brokerId(),
Integer.valueOf(topic.partitions().get(tp.partition()).leader().id()));
}
if (isTriggeredByUserRequest) {
EasyMock.verify(mockUserTaskInfo, mockUserTaskManager, mockExecutorNotifier, mockLoadMonitor, mockAnomalyDetectorManager);
Expand Down
Loading