Skip to content

Commit 0ef2c4a

Browse files
committed
Disable fallback on benchmark test
1 parent 236d48d commit 0ef2c4a

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

httprateredis_test.go

+8-7
Original file line numberDiff line numberDiff line change
@@ -156,13 +156,14 @@ func TestRedisCounter(t *testing.T) {
156156

157157
func BenchmarkLocalCounter(b *testing.B) {
158158
limitCounter, err := httprateredis.NewRedisLimitCounter(&httprateredis.Config{
159-
Host: "localhost",
160-
Port: 6379,
161-
MaxIdle: 500,
162-
MaxActive: 500,
163-
DBIndex: 0,
164-
ClientName: "httprateredis_test",
165-
PrefixKey: fmt.Sprintf("httprate:test:%v", rand.Int31n(100000)), // Unique key for each test
159+
Host: "localhost",
160+
Port: 6379,
161+
MaxIdle: 500,
162+
MaxActive: 500,
163+
DBIndex: 0,
164+
ClientName: "httprateredis_test",
165+
PrefixKey: fmt.Sprintf("httprate:test:%v", rand.Int31n(100000)), // Unique key for each test
166+
FallbackDisabled: true,
166167
})
167168
if err != nil {
168169
b.Fatalf("redis not available: %v", err)

0 commit comments

Comments
 (0)