Fixed test failure.

Relates to #3256
This commit is contained in:
Martijn van Groningen 2018-01-12 14:04:26 +01:00
parent a56b0479e1
commit 18788531c8
2 changed files with 3 additions and 3 deletions

View File

@ -269,7 +269,7 @@ public class ShardFollowTasksExecutor extends PersistentTasksExecutor<ShardFollo
if (retryCounter.incrementAndGet() <= PROCESSOR_RETRY_LIMIT) {
start(from, to);
} else {
handler.accept(new ElasticsearchException("retrying failed [" + PROCESSOR_RETRY_LIMIT +
handler.accept(new ElasticsearchException("retrying failed [" + retryCounter.get() +
"] times, aborting...", e));
}
} else {

View File

@ -210,7 +210,7 @@ public class ChunksCoordinatorTests extends ESTestCase {
public void testChunkProcessorRetry() {
Client client = mock(Client.class);
mockBulkShardOperationsApiCall(client);
int testRetryLimit = randomIntBetween(1, ShardFollowTasksExecutor.PROCESSOR_RETRY_LIMIT);
int testRetryLimit = randomIntBetween(1, ShardFollowTasksExecutor.PROCESSOR_RETRY_LIMIT - 1);
mockShardCangesApiCallWithRetry(client, testRetryLimit, new ConnectException("connection exception"));
Executor ccrExecutor = Runnable::run;
@ -244,7 +244,7 @@ public class ChunksCoordinatorTests extends ESTestCase {
chunkProcessor.start(0, 10);
assertThat(invoked[0], is(true));
assertThat(exception[0], notNullValue());
assertThat(exception[0].getMessage(), equalTo("retrying failed [16] times, aborting..."));
assertThat(exception[0].getMessage(), equalTo("retrying failed [17] times, aborting..."));
assertThat(exception[0].getCause().getMessage(), equalTo("connection exception"));
assertThat(chunkProcessor.retryCounter.get(), equalTo(testRetryLimit));
}