Skip to content

Commit

Permalink
Fix Failing Assertion in SnapshotsInProgress (#37922)
Browse files Browse the repository at this point in the history
* Fix assertion by workaround for `5.6`
* Reenable test that tripped this assertion
* Closes #31054
  • Loading branch information
original-brownbear authored Jan 30, 2019
1 parent c289fd3 commit d61e45d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -240,8 +240,11 @@ public ShardSnapshotStatus(String nodeId, State state) {
public ShardSnapshotStatus(String nodeId, State state, String reason) {
this.nodeId = nodeId;
this.state = state;
this.reason = reason;
// If the state is failed we have to have a reason for this failure
if (state.failed() && reason == null) {
reason = "failed";
}
this.reason = reason;
assert state.failed() == false || reason != null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2706,7 +2706,6 @@ public void testCannotCreateSnapshotsWithSameName() throws Exception {
assertThat(createSnapshotResponse.getSnapshotInfo().snapshotId().getName(), equalTo(snapshotName));
}

@AwaitsFix(bugUrl = "https://github.com/elastic/elasticsearch/issues/31054")
public void testGetSnapshotsRequest() throws Exception {
final String repositoryName = "test-repo";
final String indexName = "test-idx";
Expand Down

0 comments on commit d61e45d

Please sign in to comment.