Skip to content

Commit

Permalink
health-tester: Make sure to compare health with same time
Browse files Browse the repository at this point in the history
Otherwise absolutely every error message is going to be slightly
different.
  • Loading branch information
victorges committed Dec 20, 2021
1 parent 4203319 commit 85d96ba
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion internal/testers/stream_health.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,7 @@ type checkResult struct {
func (h *streamHealth) checkAllRegions(logErrs bool) <-chan checkResult {
results := make(chan checkResult, 2)
wg := sync.WaitGroup{}
startTime := time.Now()
for region := range h.clients {
wg.Add(1)
go func(region string) {
Expand All @@ -112,7 +113,7 @@ func (h *streamHealth) checkAllRegions(logErrs bool) <-chan checkResult {
err = fmt.Errorf("`healthy` condition unavailable")
} else if !*healthy {
err = fmt.Errorf("`healthy` condition is `false`")
} else if age := time.Since(health.Healthy.LastProbeTime.Time); age > time.Minute {
} else if age := startTime.Sub(health.Healthy.LastProbeTime.Time); age > time.Minute {
err = fmt.Errorf("stream health is outdated (`%s`)", age)
}
if err != nil && (logErrs || bool(glog.V(model.VVERBOSE))) {
Expand Down

0 comments on commit 85d96ba

Please sign in to comment.