Fix benchmark tests

This commit is contained in:
Ken Hibino
2020-01-18 10:17:39 -08:00
parent c29200b1fc
commit 207a6d2d1a
5 changed files with 28 additions and 13 deletions

View File

@@ -16,11 +16,17 @@ import (
// This file defines test helper functions used by
// other test files.
// redis used for package testing.
const (
redisAddr = "localhost:6379"
redisDB = 14
)
func setup(tb testing.TB) *redis.Client {
tb.Helper()
r := redis.NewClient(&redis.Options{
Addr: "localhost:6379",
DB: 14,
Addr: redisAddr,
DB: redisDB,
})
// Start each test with a clean slate.
h.FlushDB(tb, r)