diff --git a/server/src/test/java/org/elasticsearch/snapshots/SnapshotResiliencyTests.java b/server/src/test/java/org/elasticsearch/snapshots/SnapshotResiliencyTests.java index 0c54184e91357..8981c80409d44 100644 --- a/server/src/test/java/org/elasticsearch/snapshots/SnapshotResiliencyTests.java +++ b/server/src/test/java/org/elasticsearch/snapshots/SnapshotResiliencyTests.java @@ -779,8 +779,8 @@ public void onFailure(Exception e) { assertThat(snapshotIds, hasSize(1)); final SnapshotInfo snapshotInfo = repository.getSnapshotInfo(snapshotIds.iterator().next()); - assertEquals(SnapshotState.SUCCESS, snapshotInfo.state()); if (partialSnapshot) { + assertThat(snapshotInfo.state(), either(is(SnapshotState.SUCCESS)).or(is(SnapshotState.PARTIAL))); // Single shard for each index so we either get all indices or all except for the deleted index assertThat(snapshotInfo.successfulShards(), either(is(indices + 1)).or(is(indices))); if (snapshotInfo.successfulShards() == indices + 1) { @@ -790,6 +790,7 @@ public void onFailure(Exception e) { assertEquals(indexMetadata.getIndex(), firstIndex.get()); } } else { + assertEquals(snapshotInfo.state(), SnapshotState.SUCCESS); // Index delete must be blocked for non-partial snapshots and we get a snapshot for every index assertEquals(snapshotInfo.successfulShards(), indices + 1); }