ESIndexLevelReplicationTestCase.ReplicationAction#execute should send exceptions to it's listener rather than bubble them up

This is how TRA works as well.
This commit is contained in:
Boaz Leskes 2017-06-22 23:37:08 +02:00
parent fb8c767737
commit d20cd6afcb
1 changed files with 28 additions and 24 deletions

View File

@ -421,7 +421,8 @@ public abstract class ESIndexLevelReplicationTestCase extends IndexShardTestCase
this.opType = opType;
}
public void execute() throws Exception {
public void execute() {
try {
new ReplicationOperation<Request, ReplicaRequest, PrimaryResult>(request, new PrimaryRef(),
new ActionListener<PrimaryResult>() {
@Override
@ -451,6 +452,9 @@ public abstract class ESIndexLevelReplicationTestCase extends IndexShardTestCase
.collect(Collectors.toSet());
}
}.execute();
} catch (Exception e) {
listener.onFailure(e);
}
}
protected abstract PrimaryResult performOnPrimary(IndexShard primary, Request request) throws Exception;