@@ -18,7 +18,6 @@ package posting
1818
1919import (
2020 "context"
21- "fmt"
2221 "math"
2322 "math/rand"
2423 "os"
@@ -447,7 +446,7 @@ func TestReadSingleValue(t *testing.T) {
447446 key := x .DataKey (x .GalaxyAttr ("value" ), 1240 )
448447 ol , err := getNew (key , ps , math .MaxUint64 )
449448 require .NoError (t , err )
450- N := int (1e2 )
449+ N := int (10000 )
451450 for i := 2 ; i <= N ; i += 2 {
452451 edge := & pb.DirectedEdge {
453452 Value : []byte ("ho hey there" + strconv .Itoa (i )),
@@ -462,11 +461,23 @@ func TestReadSingleValue(t *testing.T) {
462461 }
463462 writer .Flush ()
464463
465- for j := 2 ; j < i + 6 ; j ++ {
466- k , err , _ := GetSingleValueForKey (key , uint64 (j ))
464+ if i % 10 == 0 {
465+ // Do frequent rollups, and store data in old timestamp
466+ kvs , err := ol .Rollup (nil , txn .StartTs - 3 )
467+ require .NoError (t , err )
468+ require .NoError (t , writePostingListToDisk (kvs ))
469+ ol , err = getNew (key , ps , math .MaxUint64 )
470+ require .NoError (t , err )
471+ }
472+
473+ j := 2
474+ if j < int (ol .minTs ) {
475+ j = int (ol .minTs )
476+ }
477+ for ; j < i + 6 ; j ++ {
478+ k , err := GetSingleValueForKey (key , uint64 (j ))
467479 require .NoError (t , err )
468480 p := getFirst (t , k , uint64 (j ))
469- fmt .Println ("Here" , p )
470481 checkValue (t , ol , string (p .Value ), uint64 (j ))
471482 }
472483
0 commit comments