Browse Source

address comments

pull/7349/head
chrislu 22 hours ago
parent
commit
069e92b82e
  1. 10
      weed/storage/store_load_balancing_simple_test.go
  2. 3
      weed/storage/store_load_balancing_test.go

10
weed/storage/store_load_balancing_simple_test.go

@ -3,6 +3,7 @@ package storage
import (
"os"
"path/filepath"
"strconv"
"testing"
"github.com/seaweedfs/seaweedfs/weed/storage/needle"
@ -22,7 +23,7 @@ func TestLoadBalancingDistribution(t *testing.T) {
numDirs := 3
for i := 0; i < numDirs; i++ {
dir := filepath.Join(tempDir, "dir"+string(rune('0'+i)))
dir := filepath.Join(tempDir, "dir"+strconv.Itoa(i))
os.MkdirAll(dir, 0755)
dirs = append(dirs, dir)
maxCounts = append(maxCounts, 100) // high limit
@ -83,10 +84,3 @@ func TestLoadBalancingDistribution(t *testing.T) {
}
}
}
// TestLoadBalancingWithRemoteVolumes tests that remote volumes are ignored in load balancing
func TestLoadBalancingWithRemoteVolumes(t *testing.T) {
// This is a unit test of LocalVolumesLen() which we already test above
// The integration test is complex due to file creation, so we'll keep it simple
t.Skip("Already tested by TestLocalVolumesLen")
}

3
weed/storage/store_load_balancing_test.go

@ -3,6 +3,7 @@ package storage
import (
"os"
"path/filepath"
"strconv"
"testing"
"github.com/seaweedfs/seaweedfs/weed/pb/volume_server_pb"
@ -231,7 +232,7 @@ func createTestVolume(vid needle.VolumeId, isRemote bool) *Volume {
if isRemote {
vol.hasRemoteFile = true
vol.volumeInfo.Files = []*volume_server_pb.RemoteFile{
{BackendType: "s3", BackendId: "test", Key: "remote-key-" + string(rune(vid))},
{BackendType: "s3", BackendId: "test", Key: "remote-key-" + strconv.Itoa(int(vid))},
}
}

Loading…
Cancel
Save