Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,14 @@

import java.time.Duration;
import org.junit.jupiter.api.Test;
import software.amazon.awssdk.testutils.retry.RetryableTest;
import software.amazon.awssdk.utils.Pair;

public abstract class BaseApiCallAttemptTimeoutTest extends BaseTimeoutTest {

protected static final Duration API_CALL_ATTEMPT_TIMEOUT = Duration.ofMillis(100);
protected static final Duration DELAY_BEFORE_API_CALL_ATTEMPT_TIMEOUT = Duration.ofMillis(50);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was not able to reproduce the test pertaining to this timeout since the value here is already low. I don't think lowering it under 50ms is going to solve anything.

protected static final Duration DELAY_AFTER_API_CALL_ATTEMPT_TIMEOUT = Duration.ofMillis(150);
protected static final Duration DELAY_AFTER_API_CALL_ATTEMPT_TIMEOUT = Duration.ofMillis(500);

@Test
public void nonstreamingOperation200_finishedWithinTime_shouldSucceed() throws Exception {
Expand All @@ -45,13 +46,13 @@ public void nonstreamingOperation500_finishedWithinTime_shouldNotTimeout() throw
verifyFailedResponseNotTimedOut();
}

@Test
@RetryableTest(maxRetries = 3)
public void nonstreamingOperation500_notFinishedWithinTime_shouldTimeout() {
stubErrorResponse(DELAY_AFTER_API_CALL_ATTEMPT_TIMEOUT);
verifyTimedOut();
}

@Test
@RetryableTest(maxRetries = 3)
public void streamingOperation_finishedWithinTime_shouldSucceed() throws Exception {
stubSuccessResponse(DELAY_BEFORE_API_CALL_ATTEMPT_TIMEOUT);
verifySuccessResponseNotTimedOut();
Expand Down
Loading