mirror of https://github.com/tikv/client-go.git
unionstore: speed up unit test (#195)
Signed-off-by: disksing <i@disksing.com>
This commit is contained in:
parent
58b6783d1b
commit
48c6c43f04
|
|
@ -48,7 +48,7 @@ import (
|
||||||
func TestRandom(t *testing.T) {
|
func TestRandom(t *testing.T) {
|
||||||
require := require.New(t)
|
require := require.New(t)
|
||||||
|
|
||||||
const cnt = 500000
|
const cnt = 50000
|
||||||
keys := make([][]byte, cnt)
|
keys := make([][]byte, cnt)
|
||||||
for i := range keys {
|
for i := range keys {
|
||||||
keys[i] = make([]byte, rand.Intn(19)+1)
|
keys[i] = make([]byte, rand.Intn(19)+1)
|
||||||
|
|
@ -132,7 +132,7 @@ func testRandomDeriveRecur(t *testing.T, db *MemDB, golden *leveldb.DB, depth in
|
||||||
golden.Put(keys[i], vals[i])
|
golden.Put(keys[i], vals[i])
|
||||||
}
|
}
|
||||||
|
|
||||||
if depth < 2000 {
|
if depth < 100 {
|
||||||
childOps := testRandomDeriveRecur(t, db, golden, depth+1)
|
childOps := testRandomDeriveRecur(t, db, golden, depth+1)
|
||||||
opLog = append(opLog, childOps...)
|
opLog = append(opLog, childOps...)
|
||||||
}
|
}
|
||||||
|
|
@ -151,7 +151,7 @@ func testRandomDeriveRecur(t *testing.T, db *MemDB, golden *leveldb.DB, depth in
|
||||||
db.Release(h)
|
db.Release(h)
|
||||||
}
|
}
|
||||||
|
|
||||||
if depth%200 == 0 {
|
if depth%10 == 0 {
|
||||||
checkConsist(t, db, golden)
|
checkConsist(t, db, golden)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue