Skip to content

Commit

Permalink
Fix CorruptedBlobStoreRepository Test (elastic#51128) (elastic#51186)
Browse files Browse the repository at this point in the history
The tests, when creating broken serialized blobs could randomly create
a sequence of bytes that is partially readable by the deserializer and then
not throw `IOException` but instead `ElasticsearchParseException`.
We should just handle these unexpected exceptions downstream properly and pass them
wrapped as `RepositoryException` to the listener to fix the test and keep the API consistent.
  • Loading branch information
original-brownbear authored Jan 18, 2020
1 parent e6f7784 commit 694b8ab
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1110,6 +1110,9 @@ public void getRepositoryData(ActionListener<RepositoryData> listener) {
listener.onFailure(e);
}
return;
} catch (Exception e) {
listener.onFailure(new RepositoryException(metadata.name(), "Unexpected exception when loading repository data", e));
return;
}
}
}
Expand Down

0 comments on commit 694b8ab

Please sign in to comment.