Commit 502e05c2 authored by Kirill Smelkov's avatar Kirill Smelkov

X found why TestΔBTailAllStructs was not effective to find δtkeycov bugs

It was due to thinko in iterating through keys set - we were using key
ordinals instead of keys themselvs. Now it find such bugs:

=== RUN   TestΔBTailAllStructs/Update/T1,3/B0:d-B1:a-B3:d,4:g→T1,4/B0:e-B1:a-B4:c
    δbtail_test.go:839: 2: trackSet:
                have: map[000000000000000c:{pffffffffffffffff c2} 00000000000005c2:{p000000000000000c c0} 0000000000000618:{p000000000000000c c0}]
                want: map[000000000000000c:{pffffffffffffffff c3} 00000000000005c2:{p000000000000000c c0} 0000000000000618:{p000000000000000c c0} 0000000000000620:{p000000000000000c c0}]
    δbtail_test.go:708: T1,3/B0:d-B1:a-B3:d,4:g -> T1,4/B0:e-B1:a-B4:c  ; tracked={0 1} :

        d12:  map[0:{d e} 3:{d ø} 4:{g c}]
        δTok: map[0:{d e} 3:{d ø} 4:{g c}]
        δT:   map[0:{d e}]

        δZ:               {000000000000000c 0000000000000618 0000000000000620}
        Tracked^δZ:       {0 1}
        kadj[Tracked^δZ]: {0 1 3 4 9223372036854775807}
        kadj: map[0:{0} 1:{1 3 4 9223372036854775807} 3:{1 3 4 9223372036854775807} 4:{1 3 4 9223372036854775807} 9223372036854775807:{1 3 4 9223372036854775807}]

        δtkeycov wrong:
        have: {}
        want: {[3,∞)}
        δT    ∌  δTok[3]
        δT    ∌  δTok[4]
parent 35bbf9b9
......@@ -671,7 +671,7 @@ ABcov:
// ac can be skipped if key coverage stays the same
ar := KeyRange{ac.lo, ac.hi_}
br := KeyRange{bc.lo, bc.hi_}
if ar == br {
if ar == br /*XXX temp to fail*/|| true {
// adjust trackSet since path to the node could have changed
apath := ac.Path()
bpath := bc.Path()
......
......@@ -1696,6 +1696,9 @@ func TestΔBTail(t *testing.T) {
// ----//---- depth=2
"T3/T-T/B1:a,2:b-B8:c,9:d",
"T7/T-T/B1:a,2:b-B8:c,9:d",
// ----//---- found by AllStructs
"T1,3/B0:d-B1:a-B3:d,4:g",
"T1,4/B0:e-B1:a-B4:c",
......@@ -1857,8 +1860,8 @@ func TestΔBTailAllStructs(t *testing.T) {
kv1 := map[Key]string{}
kv2 := map[Key]string{}
for k := range keys1 { kv1[Key(k)] = randv() }
for k := range keys2 { kv2[Key(k)] = randv() }
for _, k := range keys1 { kv1[Key(k)] = randv() }
for _, k := range keys2 { kv2[Key(k)] = randv() }
// given (kv1, kv2) - test on automatically generated (tree1 -> tree2)
reqSeed := rng.Int63()
......
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