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

stacklok / toolhive / 25866747879
66%

Build:
DEFAULT BRANCH: main
Ran 14 May 2026 02:53PM UTC
Jobs 1
Files 730
Run time 2min
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

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>

50 of 51 new or added lines in 1 file covered. (98.04%)

35 existing lines in 5 files now uncovered.

64695 of 98971 relevant lines covered (65.37%)

62.56 hits per line

Uncovered Changes

Lines Coverage ∆ File
1
56.13
4.91% pkg/workloads/manager.go

Coverage Regressions

Lines Coverage ∆ File
12
75.09
-4.33% pkg/client/config.go
12
67.9
-14.81% pkg/client/discovery.go
8
23.56
-4.6% pkg/client/manager.go
2
96.46
0.0% pkg/authserver/storage/memory.go
1
56.13
4.91% pkg/workloads/manager.go
Jobs
ID Job ID Ran Files Coverage
1 25866747879.1 14 May 2026 02:53PM UTC 730
65.37
GitHub Action Run
Source Files on build 25866747879
  • Tree
  • List 730
  • Changed 8
  • Source Changed 2
  • Coverage Changed 7
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #25866747879
  • 594ae1ef on github
  • Prev Build on main (#25860163109)
  • Next Build on main (#25868544070)
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