|
7 | 7 |
|
8 | 8 | import org.elasticsearch.action.UnavailableShardsException;
|
9 | 9 | import org.elasticsearch.common.UUIDs;
|
| 10 | +import org.elasticsearch.common.breaker.CircuitBreaker; |
| 11 | +import org.elasticsearch.common.breaker.CircuitBreakingException; |
10 | 12 | import org.elasticsearch.common.unit.ByteSizeUnit;
|
11 | 13 | import org.elasticsearch.common.unit.ByteSizeValue;
|
12 | 14 | import org.elasticsearch.common.unit.TimeValue;
|
| 15 | +import org.elasticsearch.common.util.concurrent.EsRejectedExecutionException; |
13 | 16 | import org.elasticsearch.index.seqno.LocalCheckpointTracker;
|
14 | 17 | import org.elasticsearch.index.shard.ShardId;
|
15 | 18 | import org.elasticsearch.index.translog.Translog;
|
@@ -311,7 +314,10 @@ private static TestRun createTestRun(
|
311 | 314 | List<TestResponse> item = new ArrayList<>();
|
312 | 315 | // Sometimes add a random retryable error
|
313 | 316 | if (sometimes()) {
|
314 |
| - Exception error = new UnavailableShardsException(new ShardId("test", "test", 0), ""); |
| 317 | + Exception error = randomFrom( |
| 318 | + new UnavailableShardsException(new ShardId("test", "test", 0), ""), |
| 319 | + new CircuitBreakingException("test", randomInt(), randomInt(), randomFrom(CircuitBreaker.Durability.values())), |
| 320 | + new EsRejectedExecutionException("test")); |
315 | 321 | item.add(new TestResponse(error, mappingVersion, settingsVersion, null));
|
316 | 322 | }
|
317 | 323 | // Sometimes add an empty shard changes response to also simulate a leader shard lagging behind
|
|
0 commit comments