• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

stacklok / toolhive / 25866747879 / 1
66%
main: 66%

Build:
DEFAULT BRANCH: main
Ran 14 May 2026 02:53PM UTC
Files 730
Run time 39s
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

14 May 2026 02:47PM UTC coverage: 65.368% (+0.02%) from 65.346%
25866747879.1

push

github

web-flow
Reset RunWorkload retry counter after stable run (#5172)

* Reset RunWorkload retry counter after stable run

When the Docker daemon is repeatedly unresponsive, the RunWorkload
retry loop's 10-attempt budget can be exhausted by short-lived but
successful starts: the container exits, the manager retries, the new
container runs healthily for tens of seconds before the next
disruption kills it, and the cycle repeats. After 10 cycles the
manager logs "failed to restart after max attempts, giving up" and
the workload stays offline until manually restarted, even though
the original cause was transient.

Track the duration of each runner.Run call. If the workload ran past
a stable threshold before failing, treat the next attempt as a fresh
failure rather than a continuation of the current retry sequence:
reset the attempt counter and backoff delay. This preserves the
budget's role as a bound on tight crash loops while allowing
recovery from sustained external disturbances.

Add a small testability seam (runner factory on DefaultManager,
defaulting to runner.NewRunner) so the retry loop has unit-test
coverage of the boundary cases.

Fixes #5171

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
Signed-off-by: Greg Katz <gkatz@indeed.com>

* Use functional options for retry test injection

Replace direct struct-field assignment in tests with an unexported
managerOption type and two helper functions (withRetryConfig and
withRunnerFactory). The struct fields stop advertising test-only intent
in their comments; the options carry that intent now.

Also rewrite the retry loop with an explicit attempt counter so the
reset and increment paths do not rely on the for-clause's implicit
increment.

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
Signed-off-by: Greg Katz <gkatz@indeed.com>

---------

Signed-off-by: Greg Katz <gkatz@indeed.com>
Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
Co-authored-by: Muhammad Amir Ejaz <amir@stacklok.com>

64695 of 98971 relevant lines covered (65.37%)

62.56 hits per line

Source Files on job 25866747879.1
  • Tree
  • List 730
  • Changed 8
  • Source Changed 2
  • Coverage Changed 7
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Build 25866747879
  • 594ae1ef on github
  • Prev Job for on main (#25860163109.1)
  • Next Job for on main (#25868544070.1)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc