Get more information when reindex test fails

It looks like it leaks contexts but it isn't clear why so this
adds a little more logging. This is the failure:
https://elasticsearch-ci.elastic.co/job/elastic+elasticsearch+5.4+multijob-intake/94/console
This commit is contained in:
Nik Everett 2017-05-10 23:30:01 -04:00
parent b6cb9a4e8a
commit e49ebd04fd

View File

@ -22,6 +22,7 @@ package org.elasticsearch.index.reindex;
import org.elasticsearch.action.bulk.BulkItemResponse.Failure;
import org.elasticsearch.action.bulk.byscroll.BulkByScrollResponse;
import org.elasticsearch.action.index.IndexRequestBuilder;
import org.elasticsearch.test.junit.annotations.TestLogging;
import java.util.ArrayList;
import java.util.List;
@ -38,6 +39,7 @@ import static org.hamcrest.Matchers.lessThanOrEqualTo;
/**
* Tests failure capturing and abort-on-failure behavior of reindex.
*/
@TestLogging("_root:DEBUG")
public class ReindexFailureTests extends ReindexTestCase {
public void testFailuresCauseAbortDefault() throws Exception {
/*
@ -107,7 +109,7 @@ public class ReindexFailureTests extends ReindexTestCase {
logger.info("Didn't trigger a reindex failure on the {} attempt", attempt);
attempt++;
} catch (ExecutionException e) {
logger.info("Triggered a reindex failure on the {} attempt", attempt);
logger.info("Triggered a reindex failure on the {} attempt: {}", attempt, e.getMessage());
assertThat(e.getMessage(),
either(containsString("all shards failed"))
.or(containsString("No search context found"))