|
43 | 43 | import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
|
44 | 44 | import static org.hamcrest.Matchers.containsString;
|
45 | 45 | import static org.hamcrest.Matchers.equalTo;
|
| 46 | +import static org.hamcrest.Matchers.not; |
46 | 47 |
|
47 | 48 | public class SearchCancellationIT extends AbstractSearchCancellationTestCase {
|
48 | 49 |
|
@@ -97,9 +98,7 @@ public void testCancellationDuringTimeSeriesAggregation() throws Exception {
|
97 | 98 | }
|
98 | 99 |
|
99 | 100 | logger.info("Executing search");
|
100 |
| - // we have to explicitly set error_trace=true for the later exception check for `TimeSeriesIndexSearcher` |
101 | 101 | Client client = client();
|
102 |
| - client.threadPool().getThreadContext().putHeader("error_trace", "true"); |
103 | 102 | TimeSeriesAggregationBuilder timeSeriesAggregationBuilder = new TimeSeriesAggregationBuilder("test_agg");
|
104 | 103 | ActionFuture<SearchResponse> searchResponse = client.prepareSearch("test")
|
105 | 104 | .setQuery(matchAllQuery())
|
@@ -129,7 +128,9 @@ public void testCancellationDuringTimeSeriesAggregation() throws Exception {
|
129 | 128 | logger.info("All shards failed with", ex);
|
130 | 129 | if (lowLevelCancellation) {
|
131 | 130 | // Ensure that we cancelled in TimeSeriesIndexSearcher and not in reduce phase
|
132 |
| - assertThat(ExceptionsHelper.stackTrace(ex), containsString("TimeSeriesIndexSearcher")); |
| 131 | + assertThat(ExceptionsHelper.stackTrace(ex), not(containsString("not building sub-aggregations due to task cancellation"))); |
| 132 | + } else { |
| 133 | + assertThat(ExceptionsHelper.stackTrace(ex), containsString("not building sub-aggregations due to task cancellation")); |
133 | 134 | }
|
134 | 135 | }
|
135 | 136 | }
|
0 commit comments