Skip to content

Commit 1eaf6e9

Browse files
halspangjavier-aliaga
authored andcommitted
Fix integration test retry extension (microsoft#227)
* Fix integration test retry extension The integration tests were using a retry extension that was eating exceptions and hiding failures. This commit removes the customer extension and relies on gradle's built in retry. Signed-off-by: Hal Spang <[email protected]> Signed-off-by: Javier Aliaga <[email protected]>
1 parent 22742bb commit 1eaf6e9

File tree

6 files changed

+62
-146
lines changed

6 files changed

+62
-146
lines changed

client/build.gradle

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ plugins {
77
// id 'signing'
88
id 'com.github.spotbugs' version '5.2.1'
99
id 'org.jreleaser' version '1.18.0'
10+
id 'org.gradle.test-retry' version '1.4.1'
1011
}
1112

1213
group 'io.dapr'
@@ -122,6 +123,11 @@ test {
122123
// and require external dependencies.
123124
excludeTags "integration"
124125
}
126+
127+
retry {
128+
maxRetries = 2
129+
maxFailures = 5
130+
}
125131
}
126132

127133
// Unlike normal unit tests, some tests are considered "integration tests" and shouldn't be
@@ -137,6 +143,12 @@ task integrationTest(type: Test) {
137143
testLogging.showStandardStreams = true
138144

139145
ignoreFailures = false
146+
147+
// Add retry capability for flaky integration tests
148+
retry {
149+
maxRetries = 3
150+
maxFailures = 10
151+
}
140152
}
141153

142154
publishing {

client/src/test/java/io/dapr/durabletask/ErrorHandlingIntegrationTests.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -25,13 +25,13 @@
2525
* client operations and sends invocation instructions to the DurableTaskWorker).
2626
*/
2727
@Tag("integration")
28-
@ExtendWith(TestRetryExtension.class)
2928
public class ErrorHandlingIntegrationTests extends IntegrationTestBase {
29+
3030
@BeforeEach
3131
private void startUp() {
3232
}
3333

34-
@RetryingTest
34+
@Test
3535
void orchestratorException() throws TimeoutException {
3636
final String orchestratorName = "OrchestratorWithException";
3737
final String errorMessage = "Kah-BOOOOOM!!!";
@@ -57,7 +57,7 @@ void orchestratorException() throws TimeoutException {
5757
}
5858
}
5959

60-
@RetryingParameterizedTest
60+
@ParameterizedTest
6161
@ValueSource(booleans = {true, false})
6262
void activityException(boolean handleException) throws TimeoutException {
6363
final String orchestratorName = "OrchestratorWithActivityException";
@@ -109,7 +109,7 @@ void activityException(boolean handleException) throws TimeoutException {
109109
}
110110
}
111111

112-
@RetryingParameterizedTest
112+
@ParameterizedTest
113113
@ValueSource(ints = {1, 2, 10})
114114
public void retryActivityFailures(int maxNumberOfAttempts) throws TimeoutException {
115115
// There is one task for each activity call and one task between each retry
@@ -123,7 +123,7 @@ public void retryActivityFailures(int maxNumberOfAttempts) throws TimeoutExcepti
123123
});
124124
}
125125

126-
@RetryingParameterizedTest
126+
@ParameterizedTest
127127
@ValueSource(ints = {1, 2, 10})
128128
public void retryActivityFailuresWithCustomLogic(int maxNumberOfAttempts) throws TimeoutException {
129129
// This gets incremented every time the retry handler is invoked
@@ -140,7 +140,7 @@ public void retryActivityFailuresWithCustomLogic(int maxNumberOfAttempts) throws
140140
assertEquals(maxNumberOfAttempts, retryHandlerCalls.get());
141141
}
142142

143-
@RetryingParameterizedTest
143+
@ParameterizedTest
144144
@ValueSource(booleans = {true, false})
145145
void subOrchestrationException(boolean handleException) throws TimeoutException {
146146
final String orchestratorName = "OrchestrationWithBustedSubOrchestrator";
@@ -190,7 +190,7 @@ void subOrchestrationException(boolean handleException) throws TimeoutException
190190
}
191191
}
192192

193-
@RetryingParameterizedTest
193+
@ParameterizedTest
194194
@ValueSource(ints = {1, 2, 10})
195195
public void retrySubOrchestratorFailures(int maxNumberOfAttempts) throws TimeoutException {
196196
// There is one task for each sub-orchestrator call and one task between each retry
@@ -205,7 +205,7 @@ public void retrySubOrchestratorFailures(int maxNumberOfAttempts) throws Timeout
205205
});
206206
}
207207

208-
@RetryingParameterizedTest
208+
@ParameterizedTest
209209
@ValueSource(ints = {1, 2, 10})
210210
public void retrySubOrchestrationFailuresWithCustomLogic(int maxNumberOfAttempts) throws TimeoutException {
211211
// This gets incremented every time the retry handler is invoked

0 commit comments

Comments
 (0)