-
-
Notifications
You must be signed in to change notification settings - Fork 243
Closed
Labels
featureNew feature or requestNew feature or requesthelp wantedContributions are welcomeContributions are welcomeimportantImportant taskImportant task
Milestone
Description
Currently httpexpect.Request has 4 retry policies:
- DontRetry
- RetryTemporaryNetworkErrors
- RetryTemporaryNetworkAndServerErrors
- RetryAllErrors
RetryTemporaryNetworkErrors and RetryTemporaryNetworkAndServerErrors use net.Error.Temporary to identify temporary network errors (see Request.shouldRetry). This method were deprecated in recent go versions:
// An Error represents a network error.
type Error interface {
error
Timeout() bool // Is the error a timeout?
// Deprecated: Temporary errors are not well-defined.
// Most "temporary" errors are timeouts, and the few exceptions are surprising.
// Do not use this method.
Temporary() bool
}
Hence, we should migrate from Temporary to Timeout, but without breaking compatibility.
Steps:
- introduce two new retry policies: RetryTimeoutErrors, RetryTimeoutAndServerErrors
- RetryTimeoutErrors should work like RetryTemporaryNetworkErrors, but it should use net.Error.Timeout
- RetryTimeoutAndServerErrors should work like RetryTemporaryNetworkAndServerErrors, but it should use net.Error.Timeout
- mark RetryTemporaryNetworkErrors and RetryTemporaryNetworkAndServerErrors as deprecated and suggest to use corresponding new policies instead
- update tests to work with new policies; exclude deprecated policies from tests because these tests are huge already
We will remove deprecated policies in v3.
Metadata
Metadata
Assignees
Labels
featureNew feature or requestNew feature or requesthelp wantedContributions are welcomeContributions are welcomeimportantImportant taskImportant task