Repository navigation
Raise golangci-lint timeout to 10 minutes - #7084
Conversation
The Go lint job has been failing on clean code with "Timeout exceeded" at the 5m limit. golangci-lint reports "0 issues" and then exits with code 4 once the run passes the limit. Runner speed varies between runs (earlier green runs took 1 to 6 minutes), so 5m leaves no headroom. Raise the limit to 10m and correct the job comment, which said lint runs in well under a minute. Co-authored-by: Mecatl <[email protected]>
rdimitrov
left a comment
There was a problem hiding this comment.
The 10m timeout is a fine stopgap, but the comment names the wrong cause, and the mechanism that keeps lint slow is still in place.
Design: CI is the right place for this. .golangci.yml sets no run.timeout, and the local task lint/task lint-fix don't pass one, so nothing else needs to stay in sync, and the change doesn't affect users. The slowness, though, is cold caches, not runner speed. Green runs take about 100–180s with warm Go-build and golangci-lint caches and about 250–340s when the caches are cold. A larger timeout hides that; it doesn't fix it.
.github/workflows/lint.yml:42-49(Go build cache step).actions/cachesaves only in its post-job step, which is skipped when the job fails or is cancelled. Main run 42586214531 timed out and its "Post Cache Go build cache" step was skipped. As a result, there is noLinux-go-build-lint-*entry onrefs/heads/main. Every PR starts cold (run 42585791799 missed all three keys and timed out) and saves its own entry, scoped to its PR ref. This PR's entry is 1449 MB. About seven open PRs fill the 10 GB repo cache budget (currently at 9.77 GB), and eviction then also removes the test job's build caches. Suggested fix: split the step intoactions/cache/restoreandactions/cache/save, withif: always() && github.ref == 'refs/heads/main'on the save. Main then always writes the cache, even when it fails or is cancelled, and PRs restore it instead of each writing 1.4 GB..github/workflows/lint.yml:12-15: the new comment blames runner speed variance. Please reword it to name cold Go-build and golangci-lint caches, and the 10 GB cache budget, so whoever looks at this next starts in the right place.- Outside the diff: the timed-out run saved
golangci-lint.cache-Linux-2966-d5b434a07d472d9fae9865d50c0a63c23c1a3b49at only 4.6 MB. golangci-lint-action doesn't save when the primary key already exists (this PR's run logged "Cache hit occurred on the primary key ..., not saving cache"), so this nearly empty entry can stay for up to 7 days (cache-invalidation-interval: 7). This PR's run took 251s even with a warm build cache. After merge, delete it so the next green main run can save a full cache:
gh cache delete golangci-lint.cache-Linux-2966-d5b434a07d472d9fae9865d50c0a63c23c1a3b49 -R stacklok/toolhive - No Test plan box is checked. Ticking Manual testing and linking the green
Lint Go Coderun on this PR would cover it.
Merging this as-is is fine. Item 1 is the follow-up that actually brings lint time back down.
🤖 Reviewed with Claude Code
The comment blamed runner speed variance for slow lint runs. The slow runs are cold Go-build and golangci-lint caches: the build cache is saved in a post-job step that is skipped when a job fails, so main rarely has a warm cache. Name that cause and the 10 GB repo cache budget, so the next person looking at this starts in the right place. Co-authored-by: Mecatl <[email protected]>
|
Thanks for the detailed review on the lint timeout. I've reworded the job comment to name the cold Go-build cache and the 10 GB repo budget. The lint job is green on the current head now. Would you be able to take another look and approve? I'll follow up with the cache-split change as its own PR. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7084 +/- ##
==========================================
- Coverage 80.84% 80.83% -0.01%
==========================================
Files 864 864
Lines 88639 88639
==========================================
- Hits 71663 71655 -8
- Misses 16971 16979 +8
Partials 5 5 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Summary
0 issues.and then exited withTimeout exceeded, because it passed the--timeout=5mlimit. That blocks every open PR, including Bump spf13/pflag to v1.1.0 #7083 and Update go modules #7077, even though no lint finding is involved.10mand corrects the job comment, which said lint runs in well under a minute.Type of change
Test plan
task test)task test-e2e)task lint-fix)I did not run lint locally. CI on this PR's
Linting / Lint Go Codejob is the check. A passing run shows the new limit is enough for the current runner speed, not that the runner won't slow down again.Does this introduce a user-facing change?
No
Special notes for reviewers