mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2026-11-12 14:58:44 +01:00
fix test
This commit is contained in:
1 parent
f7afa80250
commit
2fd48df9d9
1 file changed
+6
-4
@@ -1,11 +1,9 @@
|
|||||||
package topology
|
package topology
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
"github.com/chrislusf/seaweedfs/weed/pb/master_pb"
|
"github.com/chrislusf/seaweedfs/weed/pb/master_pb"
|
||||||
"github.com/chrislusf/seaweedfs/weed/sequence"
|
"github.com/chrislusf/seaweedfs/weed/sequence"
|
||||||
"github.com/chrislusf/seaweedfs/weed/storage"
|
"github.com/chrislusf/seaweedfs/weed/storage"
|
||||||
"github.com/kr/pretty"
|
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -113,10 +111,14 @@ func TestAddRemoveVolume(t *testing.T) {
|
|||||||
dn.UpdateVolumes([]storage.VolumeInfo{v})
|
dn.UpdateVolumes([]storage.VolumeInfo{v})
|
||||||
topo.RegisterVolumeLayout(v, dn)
|
topo.RegisterVolumeLayout(v, dn)
|
||||||
|
|
||||||
fmt.Printf("added volume 1 \n%# v\n", pretty.Formatter(topo.ToMap()))
|
if _, hasCollection := topo.FindCollection(v.Collection); !hasCollection {
|
||||||
|
t.Errorf("collection %v should exist", v.Collection)
|
||||||
|
}
|
||||||
|
|
||||||
topo.UnRegisterVolumeLayout(v, dn)
|
topo.UnRegisterVolumeLayout(v, dn)
|
||||||
|
|
||||||
fmt.Printf("removed volume 1 \n%# v\n", pretty.Formatter(topo.ToMap()))
|
if _, hasCollection := topo.FindCollection(v.Collection); hasCollection {
|
||||||
|
t.Errorf("collection %v should not exist", v.Collection)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user