Skip to content

Commit a4bfdff

Browse files
committed
test
1 parent fec56cb commit a4bfdff

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

internal/backoff/backoff_test.go

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,27 @@ func TestLogBackoff(t *testing.T) {
101101
{eq: 8 * time.Second}, // 1 << min(6, 3)
102102
},
103103
},
104+
{
105+
backoff: New(
106+
WithSlotDuration(time.Second),
107+
WithCeiling(6),
108+
WithJitterLimit(1),
109+
),
110+
exp: []exp{
111+
{eq: time.Second}, // 1 << min(0, 3)
112+
{eq: 2 * time.Second}, // 1 << min(1, 3)
113+
{eq: 4 * time.Second}, // 1 << min(2, 3)
114+
{eq: 8 * time.Second}, // 1 << min(3, 3)
115+
{eq: 16 * time.Second}, // 1 << min(4, 3)
116+
{eq: 32 * time.Second}, // 1 << min(5, 3)
117+
{eq: 64 * time.Second}, // 1 << min(6, 3)
118+
{eq: 64 * time.Second}, // 1 << min(6, 3)
119+
{eq: 64 * time.Second}, // 1 << min(6, 3)
120+
{eq: 64 * time.Second}, // 1 << min(6, 3)
121+
{eq: 64 * time.Second}, // 1 << min(6, 3)
122+
{eq: 64 * time.Second}, // 1 << min(6, 3)
123+
},
124+
},
104125
} {
105126
t.Run(test.name, func(t *testing.T) {
106127
if test.seeds == 0 {

0 commit comments

Comments
 (0)