Skip to content

Commit

Permalink
Use the minimal time event was observed on watch
Browse files Browse the repository at this point in the history
Signed-off-by: Marek Siarkowicz <[email protected]>
  • Loading branch information
serathius committed Oct 13, 2023
1 parent f198b41 commit 4c7b8db
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion tests/robustness/validate/patch_history.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ func uniqueWatchEvents(reports []report.ClientReport) map[model.Event]traffic.Ti
for _, op := range r.Watch {
for _, resp := range op.Responses {
for _, event := range resp.Events {
persisted[event.Event] = traffic.TimedWatchEvent{Time: resp.Time, WatchEvent: event}
responseTime := resp.Time
if prev, found := persisted[event.Event]; found && prev.Time < responseTime {
responseTime = prev.Time
}
persisted[event.Event] = traffic.TimedWatchEvent{Time: responseTime, WatchEvent: event}
}
}
}
Expand Down

0 comments on commit 4c7b8db

Please sign in to comment.