2
0
mirror of https://github.com/hibiken/asynq.git synced 2024-09-20 11:05:58 +08:00

Fix tests

This commit is contained in:
Ken Hibino 2020-01-16 21:01:27 -08:00
parent d1f516d8f1
commit f66a65d6ca
2 changed files with 6 additions and 4 deletions

View File

@ -8,7 +8,6 @@ import (
"testing" "testing"
"time" "time"
"github.com/go-redis/redis/v7"
"github.com/google/go-cmp/cmp" "github.com/google/go-cmp/cmp"
"go.uber.org/goleak" "go.uber.org/goleak"
) )
@ -18,10 +17,10 @@ func TestBackground(t *testing.T) {
ignoreOpt := goleak.IgnoreTopFunction("github.com/go-redis/redis/v7/internal/pool.(*ConnPool).reaper") ignoreOpt := goleak.IgnoreTopFunction("github.com/go-redis/redis/v7/internal/pool.(*ConnPool).reaper")
defer goleak.VerifyNoLeaks(t, ignoreOpt) defer goleak.VerifyNoLeaks(t, ignoreOpt)
r := redis.NewClient(&redis.Options{ r := &RedisClientOpt{
Addr: "localhost:6379", Addr: "localhost:6379",
DB: 15, DB: 15,
}) }
client := NewClient(r) client := NewClient(r)
bg := NewBackground(r, &Config{ bg := NewBackground(r, &Config{
Concurrency: 10, Concurrency: 10,

View File

@ -15,7 +15,10 @@ import (
func TestClient(t *testing.T) { func TestClient(t *testing.T) {
r := setup(t) r := setup(t)
client := NewClient(r) client := NewClient(&RedisClientOpt{
Addr: "localhost:6379",
DB: 14,
})
task := NewTask("send_email", map[string]interface{}{"to": "customer@gmail.com", "from": "merchant@example.com"}) task := NewTask("send_email", map[string]interface{}{"to": "customer@gmail.com", "from": "merchant@example.com"})