Skip to content

Commit 49db031

Browse files
committed
fix test
1 parent f804e95 commit 49db031

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

modules/aggregations/src/internalClusterTest/java/org/elasticsearch/aggregations/bucket/SearchCancellationIT.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
import static org.elasticsearch.test.hamcrest.ElasticsearchAssertions.assertNoFailures;
4444
import static org.hamcrest.Matchers.containsString;
4545
import static org.hamcrest.Matchers.equalTo;
46+
import static org.hamcrest.Matchers.not;
4647

4748
public class SearchCancellationIT extends AbstractSearchCancellationTestCase {
4849

@@ -97,9 +98,7 @@ public void testCancellationDuringTimeSeriesAggregation() throws Exception {
9798
}
9899

99100
logger.info("Executing search");
100-
// we have to explicitly set error_trace=true for the later exception check for `TimeSeriesIndexSearcher`
101101
Client client = client();
102-
client.threadPool().getThreadContext().putHeader("error_trace", "true");
103102
TimeSeriesAggregationBuilder timeSeriesAggregationBuilder = new TimeSeriesAggregationBuilder("test_agg");
104103
ActionFuture<SearchResponse> searchResponse = client.prepareSearch("test")
105104
.setQuery(matchAllQuery())
@@ -129,7 +128,9 @@ public void testCancellationDuringTimeSeriesAggregation() throws Exception {
129128
logger.info("All shards failed with", ex);
130129
if (lowLevelCancellation) {
131130
// 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"));
133134
}
134135
}
135136
}

0 commit comments

Comments
 (0)