Skip to content

Commit 691b3b3

Browse files
committed
Fix the test breakage. Do not assert on SrcUIDs being nil, instead return an error.
1 parent 8cb69ea commit 691b3b3

2 files changed

Lines changed: 7 additions & 1 deletion

File tree

query/query.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1909,7 +1909,11 @@ func ProcessGraph(ctx context.Context, sg, parent *SubGraph, rch chan error) {
19091909
return
19101910
}
19111911

1912-
x.AssertTruef(sg.SrcUIDs != nil, "SrcUIDs shouldn't be nil.")
1912+
if sg.SrcUIDs == nil {
1913+
glog.Errorf("SrcUIDs is unexpectedly nil. Subgraph: %+v", sg)
1914+
rch <- x.Errorf("SrcUIDs shouldn't be nil.")
1915+
return
1916+
}
19131917
// If we have a filter SubGraph which only contains an operator,
19141918
// it won't have any attribute to work on.
19151919
// This is to allow providing SrcUIDs to the filter children.

raftwal/storage.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -341,6 +341,8 @@ func (w *DiskStorage) setHardState(batch *badger.WriteBatch, st pb.HardState) er
341341

342342
// reset resets the entries. Used for testing.
343343
func (w *DiskStorage) reset(es []pb.Entry) error {
344+
w.cache = new(sync.Map) // reset cache.
345+
344346
// Clean out the state.
345347
batch := w.db.NewWriteBatch()
346348
defer batch.Cancel()

0 commit comments

Comments
 (0)