Skip to content

Commit

Permalink
Fix the test breakage. Do not assert on SrcUIDs being nil, instead re…
Browse files Browse the repository at this point in the history
…turn an error.
  • Loading branch information
manishrjain committed Mar 10, 2019
1 parent 8cb69ea commit 691b3b3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion query/query.go
Original file line number Diff line number Diff line change
Expand Up @@ -1909,7 +1909,11 @@ func ProcessGraph(ctx context.Context, sg, parent *SubGraph, rch chan error) {
return
}

x.AssertTruef(sg.SrcUIDs != nil, "SrcUIDs shouldn't be nil.")
if sg.SrcUIDs == nil {
glog.Errorf("SrcUIDs is unexpectedly nil. Subgraph: %+v", sg)
rch <- x.Errorf("SrcUIDs shouldn't be nil.")
return
}
// If we have a filter SubGraph which only contains an operator,
// it won't have any attribute to work on.
// This is to allow providing SrcUIDs to the filter children.
Expand Down
2 changes: 2 additions & 0 deletions raftwal/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -341,6 +341,8 @@ func (w *DiskStorage) setHardState(batch *badger.WriteBatch, st pb.HardState) er

// reset resets the entries. Used for testing.
func (w *DiskStorage) reset(es []pb.Entry) error {
w.cache = new(sync.Map) // reset cache.

// Clean out the state.
batch := w.db.NewWriteBatch()
defer batch.Cancel()
Expand Down

0 comments on commit 691b3b3

Please sign in to comment.