@@ -76,6 +76,7 @@ public void testAsyncSearchFailingQueryErrorTraceDefault() throws Exception {
7676 """ );
7777 createAsyncRequest .addParameter ("keep_on_completion" , "true" );
7878 createAsyncRequest .addParameter ("wait_for_completion_timeout" , "0ms" );
79+ ErrorTraceHelper .expectStackTraceCleared (internalCluster ());
7980 Map <String , Object > createAsyncResponseEntity = performRequestAndGetResponseEntity (createAsyncRequest );
8081
8182 try {
@@ -87,8 +88,6 @@ public void testAsyncSearchFailingQueryErrorTraceDefault() throws Exception {
8788 } finally {
8889 deleteAsyncSearchIfPresent (createAsyncResponseEntity );
8990 }
90- // check that the stack trace was not sent from the data node to the coordinating node
91- ErrorTraceHelper .assertStackTraceCleared (internalCluster ());
9291 }
9392
9493 public void testAsyncSearchFailingQueryErrorTraceTrue () throws Exception {
@@ -108,6 +107,7 @@ public void testAsyncSearchFailingQueryErrorTraceTrue() throws Exception {
108107 createAsyncRequest .addParameter ("error_trace" , "true" );
109108 createAsyncRequest .addParameter ("keep_on_completion" , "true" );
110109 createAsyncRequest .addParameter ("wait_for_completion_timeout" , "0ms" );
110+ ErrorTraceHelper .expectStackTraceObserved (internalCluster ());
111111 Map <String , Object > createAsyncResponseEntity = performRequestAndGetResponseEntity (createAsyncRequest );
112112
113113 try {
@@ -120,8 +120,6 @@ public void testAsyncSearchFailingQueryErrorTraceTrue() throws Exception {
120120 } finally {
121121 deleteAsyncSearchIfPresent (createAsyncResponseEntity );
122122 }
123- // check that the stack trace was sent from the data node to the coordinating node
124- ErrorTraceHelper .assertStackTraceObserved (internalCluster ());
125123 }
126124
127125 public void testAsyncSearchFailingQueryErrorTraceFalse () throws Exception {
@@ -141,6 +139,7 @@ public void testAsyncSearchFailingQueryErrorTraceFalse() throws Exception {
141139 createAsyncRequest .addParameter ("error_trace" , "false" );
142140 createAsyncRequest .addParameter ("keep_on_completion" , "true" );
143141 createAsyncRequest .addParameter ("wait_for_completion_timeout" , "0ms" );
142+ ErrorTraceHelper .expectStackTraceCleared (internalCluster ());
144143 Map <String , Object > createAsyncResponseEntity = performRequestAndGetResponseEntity (createAsyncRequest );
145144
146145 try {
@@ -153,8 +152,6 @@ public void testAsyncSearchFailingQueryErrorTraceFalse() throws Exception {
153152 } finally {
154153 deleteAsyncSearchIfPresent (createAsyncResponseEntity );
155154 }
156- // check that the stack trace was not sent from the data node to the coordinating node
157- ErrorTraceHelper .assertStackTraceCleared (internalCluster ());
158155 }
159156
160157 public void testDataNodeLogsStackTrace () throws Exception {
@@ -226,6 +223,7 @@ public void testAsyncSearchFailingQueryErrorTraceFalseOnSubmitAndTrueOnGet() thr
226223 createAsyncSearchRequest .addParameter ("error_trace" , "false" );
227224 createAsyncSearchRequest .addParameter ("keep_on_completion" , "true" );
228225 createAsyncSearchRequest .addParameter ("wait_for_completion_timeout" , "0ms" );
226+ ErrorTraceHelper .expectStackTraceCleared (internalCluster ());
229227 Map <String , Object > createAsyncResponseEntity = performRequestAndGetResponseEntity (createAsyncSearchRequest );
230228
231229 try {
@@ -238,8 +236,6 @@ public void testAsyncSearchFailingQueryErrorTraceFalseOnSubmitAndTrueOnGet() thr
238236 } finally {
239237 deleteAsyncSearchIfPresent (createAsyncResponseEntity );
240238 }
241- // check that the stack trace was not sent from the data node to the coordinating node
242- ErrorTraceHelper .assertStackTraceCleared (internalCluster ());
243239 }
244240
245241 public void testAsyncSearchFailingQueryErrorTraceTrueOnSubmitAndFalseOnGet () throws Exception {
@@ -259,6 +255,7 @@ public void testAsyncSearchFailingQueryErrorTraceTrueOnSubmitAndFalseOnGet() thr
259255 createAsyncSearchRequest .addParameter ("error_trace" , "true" );
260256 createAsyncSearchRequest .addParameter ("keep_on_completion" , "true" );
261257 createAsyncSearchRequest .addParameter ("wait_for_completion_timeout" , "0ms" );
258+ ErrorTraceHelper .expectStackTraceObserved (internalCluster ());
262259 Map <String , Object > createAsyncResponseEntity = performRequestAndGetResponseEntity (createAsyncSearchRequest );
263260 try {
264261 if (Boolean .TRUE .equals (createAsyncResponseEntity .get ("is_running" ))) {
@@ -270,8 +267,6 @@ public void testAsyncSearchFailingQueryErrorTraceTrueOnSubmitAndFalseOnGet() thr
270267 } finally {
271268 deleteAsyncSearchIfPresent (createAsyncResponseEntity );
272269 }
273- // check that the stack trace was sent from the data node to the coordinating node
274- ErrorTraceHelper .assertStackTraceObserved (internalCluster ());
275270 }
276271
277272 private Map <String , Object > performRequestAndGetResponseEntity (Request r ) throws IOException {
0 commit comments