52
52
import static org .elasticsearch .test .ClusterServiceUtils .setState ;
53
53
import static org .hamcrest .Matchers .equalTo ;
54
54
import static org .hamcrest .Matchers .instanceOf ;
55
+ import static org .hamcrest .Matchers .is ;
55
56
56
57
public class TransportHealthNodeActionTests extends ESTestCase {
57
58
private static ThreadPool threadPool ;
@@ -250,6 +251,7 @@ protected void healthOperation(Task task, Request request, ClusterState state, A
250
251
}
251
252
}, null , request , listener );
252
253
assertTrue (listener .isDone ());
254
+ assertThat (transportService .getRequestHandler ("internal:testAction" ).canTripCircuitBreaker (), is (false ));
253
255
254
256
if (healthOperationFailure ) {
255
257
try {
@@ -283,6 +285,7 @@ public void testDelegateToHealthNodeWithoutParentTask() throws ExecutionExceptio
283
285
284
286
PlainActionFuture <Response > listener = new PlainActionFuture <>();
285
287
ActionTestUtils .execute (new Action ("internal:testAction" , transportService , clusterService , threadPool ), null , request , listener );
288
+ assertThat (transportService .getRequestHandler ("internal:testAction" ).canTripCircuitBreaker (), is (false ));
286
289
287
290
assertThat (transport .capturedRequests ().length , equalTo (1 ));
288
291
CapturingTransport .CapturedRequest capturedRequest = transport .capturedRequests ()[0 ];
@@ -303,6 +306,7 @@ public void testDelegateToHealthNodeWithParentTask() throws ExecutionException,
303
306
PlainActionFuture <Response > listener = new PlainActionFuture <>();
304
307
final CancellableTask task = (CancellableTask ) taskManager .register ("type" , "internal:testAction" , request );
305
308
ActionTestUtils .execute (new Action ("internal:testAction" , transportService , clusterService , threadPool ), task , request , listener );
309
+ assertThat (transportService .getRequestHandler ("internal:testAction" ).canTripCircuitBreaker (), is (false ));
306
310
307
311
assertThat (transport .capturedRequests ().length , equalTo (1 ));
308
312
CapturingTransport .CapturedRequest capturedRequest = transport .capturedRequests ()[0 ];
@@ -327,6 +331,8 @@ public void testHealthNodeOperationWithException() throws InterruptedException {
327
331
listener
328
332
);
329
333
assertTrue (listener .isDone ());
334
+ assertThat (transportService .getRequestHandler ("internal:testAction" ).canTripCircuitBreaker (), is (false ));
335
+
330
336
try {
331
337
listener .get ();
332
338
fail ("A simulated RuntimeException should be thrown" );
0 commit comments