Test_ExponentialBackoff_Retry() — fiber Function Reference
Architecture documentation for the Test_ExponentialBackoff_Retry() function in exponential_backoff_test.go from the fiber codebase.
Entity Profile
Dependency Diagram
graph TD d5fd3ca0_d87e_1a24_c48e_180925278fa9["Test_ExponentialBackoff_Retry()"] 06704709_6b3e_c36a_84b3_c50264ae004e["exponential_backoff_test.go"] d5fd3ca0_d87e_1a24_c48e_180925278fa9 -->|defined in| 06704709_6b3e_c36a_84b3_c50264ae004e style d5fd3ca0_d87e_1a24_c48e_180925278fa9 fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
addon/retry/exponential_backoff_test.go lines 12–61
func Test_ExponentialBackoff_Retry(t *testing.T) {
t.Parallel()
tests := []struct {
expErr error
expBackoff *ExponentialBackoff
f func() error
name string
}{
{
name: "With default values - successful",
expBackoff: NewExponentialBackoff(),
f: func() error {
return nil
},
},
{
name: "Successful function",
expBackoff: &ExponentialBackoff{
InitialInterval: 1 * time.Millisecond,
MaxBackoffTime: 100 * time.Millisecond,
Multiplier: 2.0,
MaxRetryCount: 5,
},
f: func() error {
return nil
},
},
{
name: "Unsuccessful function",
expBackoff: &ExponentialBackoff{
InitialInterval: 2 * time.Millisecond,
MaxBackoffTime: 100 * time.Millisecond,
Multiplier: 2.0,
MaxRetryCount: 5,
},
f: func() error {
return errors.New("failed function")
},
expErr: errors.New("failed function"),
},
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
t.Parallel()
err := tt.expBackoff.Retry(tt.f)
require.Equal(t, tt.expErr, err)
})
}
}
Domain
Subdomains
Defined In
Source
Frequently Asked Questions
What does Test_ExponentialBackoff_Retry() do?
Test_ExponentialBackoff_Retry() is a function in the fiber codebase, defined in addon/retry/exponential_backoff_test.go.
Where is Test_ExponentialBackoff_Retry() defined?
Test_ExponentialBackoff_Retry() is defined in addon/retry/exponential_backoff_test.go at line 12.
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free