mirror of
https://github.com/hibiken/asynq.git
synced 2024-12-24 23:02:18 +08:00
Fix tests
This commit is contained in:
parent
d1f516d8f1
commit
f66a65d6ca
@ -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,
|
||||||
|
@ -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"})
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user