Skip to content

Commit

Permalink
Fix RepositoriesIT
Browse files Browse the repository at this point in the history
Signed-off-by: Sachin Kale <kalsac@amazon.com>
  • Loading branch information
Sachin Kale committed Sep 1, 2023
1 parent 9fdcb39 commit f8cf4c4
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public void testRepositoryCreation() throws Exception {
metadata = clusterStateResponse.getState().getMetadata();
repositoriesMetadata = metadata.custom(RepositoriesMetadata.TYPE);
assertThat(repositoriesMetadata, notNullValue());
assertThat(repositoriesMetadata.repositories().size(), equalTo(2));
assertThat(repositoriesMetadata.repositories().size(), equalTo(4));
assertThat(repositoriesMetadata.repository("test-repo-1"), notNullValue());
assertThat(repositoriesMetadata.repository("test-repo-1").type(), equalTo("fs"));
assertThat(repositoriesMetadata.repository("test-repo-2"), notNullValue());
Expand All @@ -106,7 +106,7 @@ public void testRepositoryCreation() throws Exception {
.cluster()
.prepareGetRepositories(randomFrom("_all", "*", "test-repo-*"))
.get();
assertThat(repositoriesResponse.repositories().size(), equalTo(2));
assertThat(repositoriesResponse.repositories().size(), equalTo(4));
assertThat(findRepository(repositoriesResponse.repositories(), "test-repo-1"), notNullValue());
assertThat(findRepository(repositoriesResponse.repositories(), "test-repo-2"), notNullValue());

Expand All @@ -127,13 +127,13 @@ public void testRepositoryCreation() throws Exception {
logger.info("--> delete repository test-repo-1");
client.admin().cluster().prepareDeleteRepository("test-repo-1").get();
repositoriesResponse = client.admin().cluster().prepareGetRepositories().get();
assertThat(repositoriesResponse.repositories().size(), equalTo(1));
assertThat(repositoriesResponse.repositories().size(), equalTo(3));
assertThat(findRepository(repositoriesResponse.repositories(), "test-repo-2"), notNullValue());

logger.info("--> delete repository test-repo-2");
client.admin().cluster().prepareDeleteRepository("test-repo-2").get();
repositoriesResponse = client.admin().cluster().prepareGetRepositories().get();
assertThat(repositoriesResponse.repositories().size(), equalTo(0));
assertThat(repositoriesResponse.repositories().size(), equalTo(2));
}

public void testResidualStaleIndicesAreDeletedByConsecutiveDelete() throws Exception {
Expand Down

0 comments on commit f8cf4c4

Please sign in to comment.