ESIndexLevelReplicationTestCase doesn't support replicated failures but it's good to know what they are

Sometimes we have a test failure that hits an `UnsupportedOperationException` in this infrastructure. When
debugging you want to know what caused this unexpected failure, but right now we're silent about it. This
commit adds some information to the `UnsupportedOperationException`

Relates to #32127
This commit is contained in:
Boaz Leskes 2018-07-17 18:06:16 +02:00
parent df1380b8d3
commit 93d7468f3a
1 changed files with 3 additions and 3 deletions

View File

@ -477,7 +477,7 @@ public abstract class ESIndexLevelReplicationTestCase extends IndexShardTestCase
@Override
public void failShard(String message, Exception exception) {
throw new UnsupportedOperationException();
throw new UnsupportedOperationException("failing a primary isn't supported. failure: " + message, exception);
}
@Override
@ -550,13 +550,13 @@ public abstract class ESIndexLevelReplicationTestCase extends IndexShardTestCase
public void failShardIfNeeded(ShardRouting replica, String message, Exception exception,
Runnable onSuccess, Consumer<Exception> onPrimaryDemoted,
Consumer<Exception> onIgnoredFailure) {
throw new UnsupportedOperationException();
throw new UnsupportedOperationException("failing shard " + replica + " isn't supported. failure: " + message, exception);
}
@Override
public void markShardCopyAsStaleIfNeeded(ShardId shardId, String allocationId, Runnable onSuccess,
Consumer<Exception> onPrimaryDemoted, Consumer<Exception> onIgnoredFailure) {
throw new UnsupportedOperationException();
throw new UnsupportedOperationException("can't mark " + shardId + ", aid [" + allocationId + "] as stale");
}
}