Skip to content

Commit

Permalink
tests: Add comments explaning handling failed requests
Browse files Browse the repository at this point in the history
  • Loading branch information
serathius committed Dec 6, 2022
1 parent ab7c4e0 commit 49467c8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions tests/linearizability/history.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ func (h *appendableHistory) AppendPut(key, value string, start, end time.Time, r
type history struct {
successful []porcupine.Operation
// failed requests are kept separate as we don't know return time of failed operations.
// Based on https://github.com/anishathalye/porcupine/issues/10
failed []porcupine.Operation
}

Expand All @@ -108,6 +109,8 @@ func (h history) Operations() []porcupine.Operation {
maxTime = op.Return
}
}
// Failed requests don't have a known return time.
// We simulate Infinity by using return time of latest successfully request.
for _, op := range h.failed {
if op.Call > maxTime {
continue
Expand Down

0 comments on commit 49467c8

Please sign in to comment.