Fix CorruptedBlobStoreRepository Test (#51128) (#51186)

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.
This commit is contained in:
Armin Braun 2020-01-18 14:12:55 +01:00 committed by GitHub
parent e6f778474e
commit 694b8ab95d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -1110,6 +1110,9 @@ public abstract class BlobStoreRepository extends AbstractLifecycleComponent imp
listener.onFailure(e);
}
return;
} catch (Exception e) {
listener.onFailure(new RepositoryException(metadata.name(), "Unexpected exception when loading repository data", e));
return;
}
}
}