Skip to content
Merged
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 @@ -20,6 +20,7 @@
package org.elasticsearch.snapshots;

import org.apache.lucene.util.SetOnce;
import org.elasticsearch.ElasticsearchException;
import org.elasticsearch.ExceptionsHelper;
import org.elasticsearch.Version;
import org.elasticsearch.action.ActionFuture;
Expand Down Expand Up @@ -768,7 +769,7 @@ public void testIncludeGlobalState() throws Exception {

}

public void testSnapshotFileFailureDuringSnapshot() throws Exception {
public void testSnapshotFileFailureDuringSnapshot() {
Client client = client();

logger.info("--> creating repository");
Expand Down Expand Up @@ -817,8 +818,12 @@ public void testSnapshotFileFailureDuringSnapshot() throws Exception {
} catch (Exception ex) {
logger.info("--> caught a top level exception, asserting what's expected", ex);
assertThat(getFailureCount("test-repo"), greaterThan(0L));
assertThat(ex.getCause(), notNullValue());
assertThat(ex.getCause().getMessage(), containsString("Random IOException"));

final Throwable cause = ex.getCause();
assertThat(cause, notNullValue());
final Throwable rootCause = new ElasticsearchException(cause).getRootCause();
assertThat(rootCause, notNullValue());
assertThat(rootCause.getMessage(), containsString("Random IOException"));
}
}

Expand Down