diff --git a/dead_pool_reaper_test.go b/dead_pool_reaper_test.go index f9fcd421..d23ba4fb 100644 --- a/dead_pool_reaper_test.go +++ b/dead_pool_reaper_test.go @@ -10,6 +10,7 @@ import ( func TestDeadPoolReaper(t *testing.T) { pool := newTestPool(":6379") ns := "work" + cleanKeyspace(ns, pool) conn := pool.Get() defer conn.Close() @@ -18,7 +19,6 @@ func TestDeadPoolReaper(t *testing.T) { // Create redis data var err error - cleanKeyspace(ns, pool) err = conn.Send("SADD", workerPoolsKey, "1") assert.NoError(t, err) err = conn.Send("SADD", workerPoolsKey, "2") @@ -50,7 +50,7 @@ func TestDeadPoolReaper(t *testing.T) { reaper := newDeadPoolReaper(ns, pool) deadPools, err := reaper.findDeadPools() assert.NoError(t, err) - assert.Equal(t, deadPools, map[string][]string{"2": {"type1", "type2"}, "3": {"type1", "type2"}}) + assert.Equal(t, map[string][]string{"2": {"type1", "type2"}, "3": {"type1", "type2"}}, deadPools) // Test requeueing jobs _, err = conn.Do("lpush", redisKeyJobsInProgress(ns, "2", "type1"), "foo") @@ -140,6 +140,7 @@ func TestDeadPoolReaperNoHeartbeat(t *testing.T) { func TestDeadPoolReaperNoJobTypes(t *testing.T) { pool := newTestPool(":6379") ns := "work" + cleanKeyspace(ns, pool) conn := pool.Get() defer conn.Close() @@ -148,7 +149,6 @@ func TestDeadPoolReaperNoJobTypes(t *testing.T) { // Create redis data var err error - cleanKeyspace(ns, pool) err = conn.Send("SADD", workerPoolsKey, "1") assert.NoError(t, err) err = conn.Send("SADD", workerPoolsKey, "2") @@ -172,7 +172,7 @@ func TestDeadPoolReaperNoJobTypes(t *testing.T) { reaper := newDeadPoolReaper(ns, pool) deadPools, err := reaper.findDeadPools() assert.NoError(t, err) - assert.Equal(t, deadPools, map[string][]string{"2": {"type1", "type2"}}) + assert.Equal(t, map[string][]string{"2": {"type1", "type2"}}, deadPools) // Test requeueing jobs _, err = conn.Do("lpush", redisKeyJobsInProgress(ns, "1", "type1"), "foo")