fix all tests

This commit is contained in:
Chris Lu
2018-07-08 02:39:04 -07:00
parent d4d7ced922
commit 5b1fd374be
7 changed files with 25 additions and 14 deletions

View File

@@ -5,6 +5,7 @@ import (
"io/ioutil"
"math/rand"
"github.com/chrislusf/seaweedfs/weed/glog"
. "github.com/chrislusf/seaweedfs/weed/storage/types"
)
func TestFastLoadingNeedleMapMetrics(t *testing.T) {
@@ -13,9 +14,9 @@ func TestFastLoadingNeedleMapMetrics(t *testing.T) {
nm := NewBtreeNeedleMap(idxFile)
for i := 0; i < 10000; i++ {
nm.Put(uint64(i+1), uint32(0), uint32(1))
nm.Put(Uint64ToNeedleId(uint64(i+1)), Uint32ToOffset(uint32(0)), uint32(1))
if rand.Float32() < 0.2 {
nm.Delete(uint64(rand.Int63n(int64(i))+1), uint32(0))
nm.Delete(Uint64ToNeedleId(uint64(rand.Int63n(int64(i))+1)), Uint32ToOffset(uint32(0)))
}
}