7
7
import org .junit .jupiter .api .Test ;
8
8
import org .junit .jupiter .params .ParameterizedTest ;
9
9
import org .junit .jupiter .params .provider .ValueSource ;
10
+ import org .junit .jupiter .api .extension .ExtendWith ;
10
11
11
12
import java .time .Duration ;
12
13
import java .util .concurrent .TimeoutException ;
13
14
import java .util .concurrent .atomic .AtomicBoolean ;
14
15
import java .util .concurrent .atomic .AtomicInteger ;
15
16
17
+ import org .junit .jupiter .api .BeforeEach ;
16
18
import static org .junit .jupiter .api .Assertions .*;
17
19
18
20
/**
23
25
* client operations and sends invocation instructions to the DurableTaskWorker).
24
26
*/
25
27
@ Tag ("integration" )
28
+ @ ExtendWith (TestRetryExtension .class )
26
29
public 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
28
37
void orchestratorException () throws TimeoutException {
29
38
final String orchestratorName = "OrchestratorWithException" ;
30
39
final String errorMessage = "Kah-BOOOOOM!!!" ;
@@ -50,7 +59,7 @@ void orchestratorException() throws TimeoutException {
50
59
}
51
60
}
52
61
53
- @ ParameterizedTest
62
+ @ RetryingParameterizedTest
54
63
@ ValueSource (booleans = {true , false })
55
64
void activityException (boolean handleException ) throws TimeoutException {
56
65
final String orchestratorName = "OrchestratorWithActivityException" ;
@@ -102,7 +111,7 @@ void activityException(boolean handleException) throws TimeoutException {
102
111
}
103
112
}
104
113
105
- @ ParameterizedTest
114
+ @ RetryingParameterizedTest
106
115
@ ValueSource (ints = {1 , 2 , 10 })
107
116
public void retryActivityFailures (int maxNumberOfAttempts ) throws TimeoutException {
108
117
// 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
116
125
});
117
126
}
118
127
119
- @ ParameterizedTest
128
+ @ RetryingParameterizedTest
120
129
@ ValueSource (ints = {1 , 2 , 10 })
121
130
public void retryActivityFailuresWithCustomLogic (int maxNumberOfAttempts ) throws TimeoutException {
122
131
// This gets incremented every time the retry handler is invoked
@@ -133,7 +142,7 @@ public void retryActivityFailuresWithCustomLogic(int maxNumberOfAttempts) throws
133
142
assertEquals (maxNumberOfAttempts , retryHandlerCalls .get ());
134
143
}
135
144
136
- @ ParameterizedTest
145
+ @ RetryingParameterizedTest
137
146
@ ValueSource (booleans = {true , false })
138
147
void subOrchestrationException (boolean handleException ) throws TimeoutException {
139
148
final String orchestratorName = "OrchestrationWithBustedSubOrchestrator" ;
@@ -183,7 +192,7 @@ void subOrchestrationException(boolean handleException) throws TimeoutException
183
192
}
184
193
}
185
194
186
- @ ParameterizedTest
195
+ @ RetryingParameterizedTest
187
196
@ ValueSource (ints = {1 , 2 , 10 })
188
197
public void retrySubOrchestratorFailures (int maxNumberOfAttempts ) throws TimeoutException {
189
198
// 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
198
207
});
199
208
}
200
209
201
- @ ParameterizedTest
210
+ @ RetryingParameterizedTest
202
211
@ ValueSource (ints = {1 , 2 , 10 })
203
212
public void retrySubOrchestrationFailuresWithCustomLogic (int maxNumberOfAttempts ) throws TimeoutException {
204
213
// This gets incremented every time the retry handler is invoked
0 commit comments