aboutsummaryrefslogtreecommitdiff
path: root/weed/cluster/lock_manager/lock_ring_test.go
diff options
context:
space:
mode:
authorchrislu <chris.lu@gmail.com>2023-06-25 00:58:21 -0700
committerchrislu <chris.lu@gmail.com>2023-06-25 00:58:21 -0700
commit3fd659df2a35c42d6a30ce251413f219ea24d1c2 (patch)
tree4fe33062833c3340d618e5c0ea2e7968f446baf5 /weed/cluster/lock_manager/lock_ring_test.go
parent051501414928baeef4a7bba7f62b08f96bcb75f7 (diff)
downloadseaweedfs-3fd659df2a35c42d6a30ce251413f219ea24d1c2.tar.xz
seaweedfs-3fd659df2a35c42d6a30ce251413f219ea24d1c2.zip
add distributed lock manager
Diffstat (limited to 'weed/cluster/lock_manager/lock_ring_test.go')
-rw-r--r--weed/cluster/lock_manager/lock_ring_test.go12
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"})