Skip to content

Commit

Permalink
Fix CorruptedBlobStoreRepository Test (elastic#51128)
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 and SivagurunathanV committed Jan 21, 2020
1 parent 396778a commit ebe33d4
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1097,6 +1097,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 ebe33d4

Please sign in to comment.