Skip to content
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

test: Add coverage for runner health monitor #39

Merged
merged 14 commits into from
Dec 2, 2024
Prev Previous commit
Next Next commit
Move log to better place
ivov committed Nov 29, 2024

Verified

This commit was signed with the committer’s verified signature.
ivov Iván Ovejero
commit db06df5fa96f7dc1d5e419ea720912fffa89c1e0
2 changes: 1 addition & 1 deletion internal/http/manage_runner_health.go
Original file line number Diff line number Diff line change
@@ -98,7 +98,6 @@ func monitorRunnerHealth(
failureCount++
logs.Warnf("Found runner unresponsive (%d/%d)", failureCount, healthCheckMaxFailures)
if failureCount >= healthCheckMaxFailures {
logs.Warn("Found runner unresponsive too many times, terminating runner...")
resultChan <- healthCheckResult{Status: StatusUnhealthy}
return
}
@@ -126,6 +125,7 @@ func ManageRunnerHealth(
result := <-resultChan
switch result.Status {
case StatusUnhealthy:
logs.Warn("Found runner unresponsive too many times, terminating runner...")
if err := cmd.Process.Kill(); err != nil {
panic(fmt.Errorf("failed to terminate unhealthy runner process: %v", err))
}