Skip to content

Commit

Permalink
Fixed a test
Browse files Browse the repository at this point in the history
  • Loading branch information
harshil-goel committed Jan 7, 2025
1 parent 6163160 commit b2b64b3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
6 changes: 6 additions & 0 deletions posting/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -873,6 +873,12 @@ func GetConflictKey(pk x.ParsedKey, key []byte, t *pb.DirectedEdge) uint64 {
return conflictKey
}

// SetTs allows us to set the transaction timestamp in mutation map. Should be used before the posting list is passed
// on to the functions that would read the data.
func (l *List) SetTs(readTs uint64) {
l.mutationMap.setTs(readTs)
}

func (l *List) addMutationInternal(ctx context.Context, txn *Txn, t *pb.DirectedEdge) error {
l.AssertLock()

Expand Down
1 change: 1 addition & 0 deletions worker/worker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ func commitTransaction(t *testing.T, edge *pb.DirectedEdge, l *posting.List) {
startTs := timestamp()
txn := posting.Oracle().RegisterStartTs(startTs)
l = txn.Store(l)
l.SetTs(startTs)
require.NoError(t, l.AddMutationWithIndex(context.Background(), edge, txn))

commit := commitTs(startTs)
Expand Down

0 comments on commit b2b64b3

Please sign in to comment.