@@ -18,7 +18,6 @@ package posting
18
18
19
19
import (
20
20
"context"
21
- "fmt"
22
21
"math"
23
22
"math/rand"
24
23
"os"
@@ -447,7 +446,7 @@ func TestReadSingleValue(t *testing.T) {
447
446
key := x .DataKey (x .GalaxyAttr ("value" ), 1240 )
448
447
ol , err := getNew (key , ps , math .MaxUint64 )
449
448
require .NoError (t , err )
450
- N := int (1e2 )
449
+ N := int (10000 )
451
450
for i := 2 ; i <= N ; i += 2 {
452
451
edge := & pb.DirectedEdge {
453
452
Value : []byte ("ho hey there" + strconv .Itoa (i )),
@@ -462,11 +461,23 @@ func TestReadSingleValue(t *testing.T) {
462
461
}
463
462
writer .Flush ()
464
463
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 ))
467
479
require .NoError (t , err )
468
480
p := getFirst (t , k , uint64 (j ))
469
- fmt .Println ("Here" , p )
470
481
checkValue (t , ol , string (p .Value ), uint64 (j ))
471
482
}
472
483
0 commit comments