Browse Source

fix build

pull/7160/head
chrislu 1 month ago
parent
commit
02ef812375
  1. 2
      unmaintained/stress_filer_upload/write_files/write_files.go
  2. 2
      weed/filer/filechunks_test.go
  3. 4
      weed/storage/volume_vacuum_test.go
  4. 2
      weed/util/skiplist/skiplist_test.go

2
unmaintained/stress_filer_upload/write_files/write_files.go

@ -33,7 +33,7 @@ func main() {
f, err := os.Create(fmt.Sprintf("%s/file%05d", *toDir, i))
check(err)
fileSize := *minSize + rand.IntN(*maxSize-*minSize)
fileSize := *minSize + rand.Intn(*maxSize-*minSize)
startTime := time.Now()
fmt.Printf("write %s %d bytes: ", f.Name(), fileSize)

2
weed/filer/filechunks_test.go

@ -5,7 +5,7 @@ import (
"fmt"
"log"
"math"
"math/rand"
"math/rand/v2"
"strconv"
"testing"

4
weed/storage/volume_vacuum_test.go

@ -157,7 +157,7 @@ func doSomeWritesDeletes(i int, v *Volume, t *testing.T, infos []*needleInfo) {
}
// println("written file", i, "checksum", n.Checksum.Value(), "size", size)
if rand.Float64() < 0.03 {
toBeDeleted := rand.IntN(i) + 1
toBeDeleted := rand.Intn(i) + 1
oldNeedle := newEmptyNeedle(uint64(toBeDeleted))
v.deleteNeedle2(oldNeedle)
// println("deleted file", toBeDeleted)
@ -175,7 +175,7 @@ type needleInfo struct {
func newRandomNeedle(id uint64) *needle.Needle {
n := new(needle.Needle)
n.Data = make([]byte, rand.IntN(1024))
n.Data = make([]byte, rand.Intn(1024))
rand.Read(n.Data)
n.Checksum = needle.NewCRC(n.Data)

2
weed/util/skiplist/skiplist_test.go

@ -2,7 +2,7 @@ package skiplist
import (
"bytes"
"math/rand"
"math/rand/v2"
"strconv"
"testing"
)

Loading…
Cancel
Save