Browse Source

Merge pull request #1304 from song-zhang/master

fix volume vacuum test unit
pull/1315/head
Chris Lu 5 years ago
committed by GitHub
parent
commit
20b8f2e5b4
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      weed/storage/volume_vacuum_test.go

4
weed/storage/volume_vacuum_test.go

@ -129,7 +129,7 @@ func TestCompaction(t *testing.T) {
} }
func doSomeWritesDeletes(i int, v *Volume, t *testing.T, infos []*needleInfo) { func doSomeWritesDeletes(i int, v *Volume, t *testing.T, infos []*needleInfo) {
n := newRandomNeedle(uint64(i)) n := newRandomNeedle(uint64(i))
_, size, _, err := v.writeNeedle(n, false)
_, size, _, err := v.writeNeedle2(n, false)
if err != nil { if err != nil {
t.Fatalf("write file %d: %v", i, err) t.Fatalf("write file %d: %v", i, err)
} }
@ -141,7 +141,7 @@ func doSomeWritesDeletes(i int, v *Volume, t *testing.T, infos []*needleInfo) {
if rand.Float64() < 0.03 { if rand.Float64() < 0.03 {
toBeDeleted := rand.Intn(i) + 1 toBeDeleted := rand.Intn(i) + 1
oldNeedle := newEmptyNeedle(uint64(toBeDeleted)) oldNeedle := newEmptyNeedle(uint64(toBeDeleted))
v.deleteNeedle(oldNeedle)
v.deleteNeedle2(oldNeedle)
// println("deleted file", toBeDeleted) // println("deleted file", toBeDeleted)
infos[toBeDeleted-1] = &needleInfo{ infos[toBeDeleted-1] = &needleInfo{
size: 0, size: 0,

Loading…
Cancel
Save