Skip to content

Commit c0789e2

Browse files
author
Harshil Goel
authored
fix(ci): delete all issue in upgrade test (#9291)
1 parent 3c27935 commit c0789e2

4 files changed

Lines changed: 26 additions & 2 deletions

File tree

posting/list.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,6 +382,10 @@ func (mm *MutableLayer) print() string {
382382
mm.deleteAllMarker)
383383
}
384384

385+
func (l *List) print() string {
386+
return fmt.Sprintf("minTs: %d, plist: %+v, mutationMap: %s", l.minTs, l.plist, l.mutationMap.print())
387+
}
388+
385389
// Return if piterator needs to be searched or not after mutable map and the posting if found.
386390
func (mm *MutableLayer) findPosting(readTs, uid uint64) (bool, *pb.Posting) {
387391
if mm == nil {
@@ -1119,7 +1123,7 @@ func (l *List) iterate(readTs uint64, afterUid uint64, f func(obj *pb.Posting) e
11191123
// pitr iterates through immutable postings
11201124
err = pitr.seek(l, afterUid, deleteBelowTs)
11211125
if err != nil {
1122-
return errors.Wrapf(err, "cannot initialize iterator when calling List.iterate")
1126+
return errors.Wrapf(err, "cannot initialize iterator when calling List.iterate "+l.print())
11231127
}
11241128

11251129
loop:

systest/mutations-and-queries/integration_test.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ func (ssuite *SystestTestSuite) SetupSubTest() {
4545
require.NoError(t, gcli.DropAll())
4646
}
4747

48+
func (ssuite *SystestTestSuite) CheckAllowedErrorPreUpgrade(err error) bool {
49+
return false
50+
}
51+
4852
func (ssuite *SystestTestSuite) Upgrade() {
4953
// Not implemented for integration tests
5054
}

systest/mutations-and-queries/mutations_test.go

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2935,7 +2935,13 @@ func (ssuite *SystestTestSuite) DeleteAndQuerySameTxn() {
29352935

29362936
q := `{ me(func: has(name)) { name } }`
29372937
resp, err := txn2.Query(ctx, q)
2938-
require.NoError(t, err)
2938+
if err != nil {
2939+
if !ssuite.CheckAllowedErrorPreUpgrade(err) {
2940+
require.NoError(t, err)
2941+
} else {
2942+
t.Skip()
2943+
}
2944+
}
29392945
dgraphapi.CompareJSON(`{"me":[{"name":"Alice"}]}`,
29402946
string(resp.GetJson()))
29412947
require.NoError(t, txn2.Commit(ctx))

systest/mutations-and-queries/upgrade_test.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ package main
2121
import (
2222
"errors"
2323
"log"
24+
"strings"
2425
"testing"
2526
"time"
2627

@@ -57,6 +58,15 @@ func (ssuite *SystestTestSuite) TearDownSubTest() {
5758
ssuite.lc.Cleanup(ssuite.T().Failed())
5859
}
5960

61+
func (ssuite *SystestTestSuite) CheckAllowedErrorPreUpgrade(err error) bool {
62+
if val, checkErr := dgraphtest.IsHigherVersion(
63+
ssuite.dc.GetVersion(),
64+
"315747a19e9d5c5b98055c8b943a6e6462153bb3"); checkErr == nil && val || checkErr != nil {
65+
return false
66+
}
67+
return strings.Contains(err.Error(), "cannot initialize iterator when calling List.iterate: deleteBelowTs")
68+
}
69+
6070
func (ssuite *SystestTestSuite) Upgrade() {
6171
require.NoError(ssuite.T(), ssuite.lc.Upgrade(ssuite.uc.After, ssuite.uc.Strategy))
6272
}

0 commit comments

Comments
 (0)