Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ci): delete all issue in upgrade test #9291

Merged
merged 4 commits into from
Jan 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion posting/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -382,6 +382,10 @@
mm.deleteAllMarker)
}

func (l *List) print() string {
return fmt.Sprintf("minTs: %d, plist: %+v, mutationMap: %s", l.minTs, l.plist, l.mutationMap.print())
}

// Return if piterator needs to be searched or not after mutable map and the posting if found.
func (mm *MutableLayer) findPosting(readTs, uid uint64) (bool, *pb.Posting) {
if mm == nil {
Expand Down Expand Up @@ -1119,7 +1123,7 @@
// pitr iterates through immutable postings
err = pitr.seek(l, afterUid, deleteBelowTs)
if err != nil {
return errors.Wrapf(err, "cannot initialize iterator when calling List.iterate")
return errors.Wrapf(err, "cannot initialize iterator when calling List.iterate "+l.print())

Check failure on line 1126 in posting/list.go

View check run for this annotation

Trunk.io / Trunk Check

golangci-lint(govet)

[new] printf: non-constant format string in call to github.com/pkg/errors.Wrapf
}

loop:
Expand Down
4 changes: 4 additions & 0 deletions systest/mutations-and-queries/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ func (ssuite *SystestTestSuite) SetupSubTest() {
require.NoError(t, gcli.DropAll())
}

func (ssuite *SystestTestSuite) CheckAllowedErrorPreUpgrade(err error) bool {
return false
}

func (ssuite *SystestTestSuite) Upgrade() {
// Not implemented for integration tests
}
Expand Down
8 changes: 7 additions & 1 deletion systest/mutations-and-queries/mutations_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2935,7 +2935,13 @@ func (ssuite *SystestTestSuite) DeleteAndQuerySameTxn() {

q := `{ me(func: has(name)) { name } }`
resp, err := txn2.Query(ctx, q)
require.NoError(t, err)
if err != nil {
if !ssuite.CheckAllowedErrorPreUpgrade(err) {
require.NoError(t, err)
} else {
t.Skip()
}
}
dgraphapi.CompareJSON(`{"me":[{"name":"Alice"}]}`,
string(resp.GetJson()))
require.NoError(t, txn2.Commit(ctx))
Expand Down
10 changes: 10 additions & 0 deletions systest/mutations-and-queries/upgrade_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ package main
import (
"errors"
"log"
"strings"
"testing"
"time"

Expand Down Expand Up @@ -57,6 +58,15 @@ func (ssuite *SystestTestSuite) TearDownSubTest() {
ssuite.lc.Cleanup(ssuite.T().Failed())
}

func (ssuite *SystestTestSuite) CheckAllowedErrorPreUpgrade(err error) bool {
if val, checkErr := dgraphtest.IsHigherVersion(
ssuite.dc.GetVersion(),
"315747a19e9d5c5b98055c8b943a6e6462153bb3"); checkErr == nil && val || checkErr != nil {
return false
}
return strings.Contains(err.Error(), "cannot initialize iterator when calling List.iterate: deleteBelowTs")
}

func (ssuite *SystestTestSuite) Upgrade() {
require.NoError(ssuite.T(), ssuite.lc.Upgrade(ssuite.uc.After, ssuite.uc.Strategy))
}
Expand Down
Loading