-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Integration] Update timeout values to work better with the service.
Integration can take 4+ hours to create if the source database is huge. Likewise, the delete should not take more than 30 minutes, so the timeouts are being adjusted.
- Loading branch information
Showing
5 changed files
with
64 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
...ds-integration/src/test/java/software/amazon/rds/integration/TimeoutVerificationTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package software.amazon.rds.integration; | ||
|
||
import org.junit.jupiter.params.ParameterizedTest; | ||
import org.junit.jupiter.params.provider.Arguments; | ||
import org.junit.jupiter.params.provider.MethodSource; | ||
import software.amazon.cloudformation.proxy.delay.Constant; | ||
|
||
import java.time.Duration; | ||
import java.util.stream.Stream; | ||
|
||
import static org.junit.jupiter.api.Assertions.assertTrue; | ||
|
||
public class TimeoutVerificationTest { | ||
|
||
@ParameterizedTest | ||
@MethodSource("timeoutsAndHandlersProvider") | ||
public void verifyDefaultBackoffConfig(final Duration timeout, final BaseHandlerStd handler) { | ||
final Constant backoffConfig = handler.config.getBackoff(); | ||
Duration totalWaitTime = Duration.ZERO; | ||
int attempt = 1; | ||
Duration delay = backoffConfig.nextDelay(attempt); | ||
while (delay != Duration.ZERO) { | ||
totalWaitTime = totalWaitTime.plus(delay); | ||
attempt += 1; | ||
delay = backoffConfig.nextDelay(attempt); | ||
} | ||
assertTrue(totalWaitTime.compareTo(timeout) >= 0); | ||
} | ||
|
||
static Stream<Arguments> timeoutsAndHandlersProvider() { | ||
return Stream.of( | ||
Arguments.arguments(Duration.ofHours(8), new CreateHandler()), | ||
Arguments.arguments(Duration.ofHours(8), new UpdateHandler()), | ||
Arguments.arguments(Duration.ofMinutes(30), new DeleteHandler()) | ||
); | ||
} | ||
} |