77import org .junit .jupiter .api .Test ;
88import org .junit .jupiter .params .ParameterizedTest ;
99import org .junit .jupiter .params .provider .ValueSource ;
10+ import org .junit .jupiter .api .extension .ExtendWith ;
1011
1112import java .time .Duration ;
1213import java .util .concurrent .TimeoutException ;
1314import java .util .concurrent .atomic .AtomicBoolean ;
1415import java .util .concurrent .atomic .AtomicInteger ;
1516
17+ import org .junit .jupiter .api .BeforeEach ;
1618import static org .junit .jupiter .api .Assertions .*;
1719
1820/**
2325 * client operations and sends invocation instructions to the DurableTaskWorker).
2426 */
2527@ Tag ("integration" )
28+ @ ExtendWith (TestRetryExtension .class )
2629public class ErrorHandlingIntegrationTests extends IntegrationTestBase {
27- @ Test
30+ @ BeforeEach
31+ private void startUp () {
32+ DurableTaskClient client = new DurableTaskGrpcClientBuilder ().build ();
33+ client .deleteTaskHub ();
34+ }
35+
36+ @ RetryingTest
2837 void orchestratorException () throws TimeoutException {
2938 final String orchestratorName = "OrchestratorWithException" ;
3039 final String errorMessage = "Kah-BOOOOOM!!!" ;
@@ -50,7 +59,7 @@ void orchestratorException() throws TimeoutException {
5059 }
5160 }
5261
53- @ ParameterizedTest
62+ @ RetryingParameterizedTest
5463 @ ValueSource (booleans = {true , false })
5564 void activityException (boolean handleException ) throws TimeoutException {
5665 final String orchestratorName = "OrchestratorWithActivityException" ;
@@ -102,7 +111,7 @@ void activityException(boolean handleException) throws TimeoutException {
102111 }
103112 }
104113
105- @ ParameterizedTest
114+ @ RetryingParameterizedTest
106115 @ ValueSource (ints = {1 , 2 , 10 })
107116 public void retryActivityFailures (int maxNumberOfAttempts ) throws TimeoutException {
108117 // There is one task for each activity call and one task between each retry
@@ -116,7 +125,7 @@ public void retryActivityFailures(int maxNumberOfAttempts) throws TimeoutExcepti
116125 });
117126 }
118127
119- @ ParameterizedTest
128+ @ RetryingParameterizedTest
120129 @ ValueSource (ints = {1 , 2 , 10 })
121130 public void retryActivityFailuresWithCustomLogic (int maxNumberOfAttempts ) throws TimeoutException {
122131 // This gets incremented every time the retry handler is invoked
@@ -133,7 +142,7 @@ public void retryActivityFailuresWithCustomLogic(int maxNumberOfAttempts) throws
133142 assertEquals (maxNumberOfAttempts , retryHandlerCalls .get ());
134143 }
135144
136- @ ParameterizedTest
145+ @ RetryingParameterizedTest
137146 @ ValueSource (booleans = {true , false })
138147 void subOrchestrationException (boolean handleException ) throws TimeoutException {
139148 final String orchestratorName = "OrchestrationWithBustedSubOrchestrator" ;
@@ -183,7 +192,7 @@ void subOrchestrationException(boolean handleException) throws TimeoutException
183192 }
184193 }
185194
186- @ ParameterizedTest
195+ @ RetryingParameterizedTest
187196 @ ValueSource (ints = {1 , 2 , 10 })
188197 public void retrySubOrchestratorFailures (int maxNumberOfAttempts ) throws TimeoutException {
189198 // There is one task for each sub-orchestrator call and one task between each retry
@@ -198,7 +207,7 @@ public void retrySubOrchestratorFailures(int maxNumberOfAttempts) throws Timeout
198207 });
199208 }
200209
201- @ ParameterizedTest
210+ @ RetryingParameterizedTest
202211 @ ValueSource (ints = {1 , 2 , 10 })
203212 public void retrySubOrchestrationFailuresWithCustomLogic (int maxNumberOfAttempts ) throws TimeoutException {
204213 // This gets incremented every time the retry handler is invoked
0 commit comments