-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Reapply "feat: support canary test for multiple load balancers (#80)"… #84
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #84 +/- ##
==========================================
- Coverage 73.93% 73.21% -0.72%
==========================================
Files 16 17 +1
Lines 890 896 +6
==========================================
- Hits 658 656 -2
- Misses 134 139 +5
- Partials 98 101 +3 ☔ View full report in Codecov by Sentry. |
@takkyuuplayer Sorry for assigning to review serially. This is exceeded changes for #81 that is temporally reverted in main, including titled feature and refactoring around |
canary_task.go
Outdated
wait := make(chan bool) | ||
go func() { | ||
duration := c.Env.CanaryTaskIdleDuration | ||
for duration > 0 { | ||
log.Infof("still waiting...; %d seconds left", duration) | ||
wt := 10 | ||
if duration < 10 { | ||
wt = duration | ||
} | ||
<-c.Time.NewTimer(time.Duration(wt) * time.Second).C | ||
duration -= 10 | ||
} | ||
wait <- true | ||
}() | ||
<-wait |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unnecessary goroutine. The below seems enough.
duration := c.Env.CanaryTaskIdleDuration
for duration > 0 {
log.Infof("still waiting...; %d seconds left", duration)
wt := 10
if duration < 10 {
wt = duration
}
<-c.Time.NewTimer(time.Duration(wt) * time.Second).C
duration -= 10
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree and ctx.Done()
should also be evaluated with select
.
canary_task.go
Outdated
return nil | ||
} | ||
|
||
func (c *CanaryTask) waitUntilHealthCeheckPassed(ctx context.Context) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo
func (c *CanaryTask) waitUntilHealthCeheckPassed(ctx context.Context) error { | |
func (c *CanaryTask) waitUntilHealthCheckPassed(ctx context.Context) error { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typo still exists
Ceheck --> Check
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've cehecked!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
… (#83)
This reverts commit d43c8c5.