Commit 2f5582e6 authored by Kirill Smelkov's avatar Kirill Smelkov

X ΔBtail: Tweak tests to run faster in normal mode

t(TestΔBTailRandom) ~320s -> ~100s.
parent e5a2ecf3
......@@ -32,6 +32,15 @@ var (
randseedFlag = flag.Int64("randseed", -1, `seed for random number generator`)
)
// VeryLong returns whether -verylong flag is in effect.
func VeryLong() bool {
// -short takes priority over -verylong
if testing.Short() {
return false
}
return *verylongFlag
}
// N returns short, medium, or long depending on whether tests were ran with
// -short, -verylong, or normally.
func N(short, medium, long int) int {
......
......@@ -476,7 +476,7 @@ func TestΔBTailRandom(t *testing.T) {
// in non-short mode rebuild tests are exercising more keys variants, plus every test case
// takes more time. Compensate for that as well.
if !testing.Short() {
nrebuild -= 3
nrebuild -= 4
}
testq := make(chan ΔBTestEntry)
......@@ -909,11 +909,11 @@ func xverifyΔBTail_rebuild(t *testing.T, db *zodb.DB, treeRoot zodb.Oid, t0, t1
/*vδT=*/ δkv1_k1R2, δkv2_k1R2)
// tRestKeys2 = tAllKeys - keys1
// reduce that to = tAllKeys - keys1R2 in short mode
// reduce that to = tAllKeys - keys1R2 in short/medium mode
// ( if key from keys2 already became tracked after Track(keys1) + Update,
// adding Track(that-key), is not adding much testing coverage to recompute paths )
var tRestKeys2 setKey
if testing.Short() {
if !xbtreetest.VeryLong() {
tRestKeys2 = tAllKeys.Difference(keys1R2)
} else {
tRestKeys2 = tAllKeys.Difference(keys1)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment