Skip to content

Commit

Permalink
fix test: wait for restore finished
Browse files Browse the repository at this point in the history
  • Loading branch information
chaohengstudent committed Mar 30, 2023
1 parent 5831866 commit c2fe8b7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions app/src/test/java/org/astraea/app/backup/BackupTest.java
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,18 @@ void testRestoreDistribution() {
.run()
.toCompletableFuture()
.join();
Utils.sleep(Duration.ofSeconds(1));
Utils.sleep(Duration.ofSeconds(2));

var clusterInfo = admin.clusterInfo(Set.of(topic1, topic2)).toCompletableFuture().join();
admin.deleteTopics(Set.of(topic1, topic2)).toCompletableFuture().join();
Utils.sleep(Duration.ofSeconds(1));
Utils.sleep(Duration.ofSeconds(2));

var backup = new Backup();
backup.restoreDistribution(clusterInfo, SERVICE.bootstrapServers());
Utils.sleep(Duration.ofSeconds(2));
var restoredClusterInfo =
admin.clusterInfo(Set.of(topic1, topic2)).toCompletableFuture().join();
Utils.sleep(Duration.ofSeconds(1));
Utils.sleep(Duration.ofSeconds(2));

Assertions.assertEquals(clusterInfo.replicas(), restoredClusterInfo.replicas());
}
Expand Down

0 comments on commit c2fe8b7

Please sign in to comment.