diff options
Diffstat (limited to 'weed/cluster/lock_manager/lock_ring_test.go')
| -rw-r--r-- | weed/cluster/lock_manager/lock_ring_test.go | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/weed/cluster/lock_manager/lock_ring_test.go b/weed/cluster/lock_manager/lock_ring_test.go index a8c88f4ab..9025309ec 100644 --- a/weed/cluster/lock_manager/lock_ring_test.go +++ b/weed/cluster/lock_manager/lock_ring_test.go @@ -8,15 +8,7 @@ import ( ) func TestAddServer(t *testing.T) { - counter := 0 - r := NewLockRing(100*time.Millisecond, func(snapshot []pb.ServerAddress) { - counter++ - if counter == 1 { - assert.Equal(t, 1, len(snapshot)) - } else if counter == 2 { - assert.Equal(t, 2, len(snapshot)) - } - }) + r := NewLockRing(100 * time.Millisecond) r.AddServer("localhost:8080") assert.Equal(t, 1, len(r.snapshots)) r.AddServer("localhost:8081") @@ -36,7 +28,7 @@ func TestAddServer(t *testing.T) { } func TestLockRing(t *testing.T) { - r := NewLockRing(100*time.Millisecond, nil) + r := NewLockRing(100 * time.Millisecond) r.SetSnapshot([]pb.ServerAddress{"localhost:8080", "localhost:8081"}) assert.Equal(t, 1, len(r.snapshots)) r.SetSnapshot([]pb.ServerAddress{"localhost:8080", "localhost:8081", "localhost:8082"}) |
