Class CircuitBreakerLateSuccessTest
java.lang.Object
org.jboss.arquillian.testng.Arquillian
org.eclipse.microprofile.fault.tolerance.tck.CircuitBreakerLateSuccessTest
- All Implemented Interfaces:
org.testng.IHookable
,org.testng.ITestNGListener
public class CircuitBreakerLateSuccessTest
extends org.jboss.arquillian.testng.Arquillian
Test CircuitBreaker using different success/failure pattern.
- Author:
- Neil Young
-
Nested Class Summary
Nested classes/interfaces inherited from class org.jboss.arquillian.testng.Arquillian
org.jboss.arquillian.testng.Arquillian.UpdateResultListener
-
Field Summary
Fields inherited from class org.jboss.arquillian.testng.Arquillian
ARQUILLIAN_DATA_PROVIDER
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.jboss.shrinkwrap.api.spec.WebArchive
deploy()
void
Analagous to testCircuitDefaultSuccessThreshold but with a different success/failure pattern for the service that is called.Methods inherited from class org.jboss.arquillian.testng.Arquillian
arquillianAfterClass, arquillianAfterSuite, arquillianAfterTest, arquillianArgumentProvider, arquillianBeforeClass, arquillianBeforeSuite, arquillianBeforeTest, run
-
Constructor Details
-
CircuitBreakerLateSuccessTest
public CircuitBreakerLateSuccessTest()
-
-
Method Details
-
deploy
@Deployment public static org.jboss.shrinkwrap.api.spec.WebArchive deploy() -
testCircuitLateSuccessDefaultSuccessThreshold
public void testCircuitLateSuccessDefaultSuccessThreshold()Analagous to testCircuitDefaultSuccessThreshold but with a different success/failure pattern for the service that is called. In this case, the service succeeds in the last call in the rolling window but the circuit will still open as the failureRatio has been breached. With requestVolumeThreshold = 4, failureRatio=0.75 and successThreshold = 1 the expected behaviour is, Execution Behaviour ========= ========= 1 RunTimeException 2 RunTimeException 3 RunTimeException 4 SUCCESS 5 CircuitBreakerOpenException Pause for longer than CircuitBreaker delay, so that it transitions to half-open 6 SUCCEED (CircuitBreaker will be re-closed as successThreshold is 1. The impact of the success of the service and the closure of the Circuit is to reset the rolling failure window to an empty state. Therefore another 4 requests need to be made - of which at least 3 need to fail - for the Circuit to open again) 7 RuntimeException 8 RunTimeException 9 RunTimeException 10 SUCCESS 11 CircuitBreakerOpenException
-