Skip to content

ci: retry the Go module download before the gate - #244

Merged
bketelsen merged 2 commits into
mainfrom
irulan/flaky-242-243
Nov 16, 2026
Merged

bketelsen merged 2 commits into
mainfrom
irulan/flaky-242-243

Conversation

@frostyard-machines

@frostyard-machines frostyard-machines commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Fixes #243. Part of #242: its failure is fixed on main already (below).

The flaky scan of 2026-11-16 found 2 jobs of frostnotes that failed and then passed on the same SHA.

#243, Verify (make verify): a download error outside the repository

Run 42974699058 (5434b8c) stopped at go mod tidy -diff:

golang.org/x/[email protected]: read "https://proxy.golang.org/golang.org/x/tools/@v/v0.52.0.zip": stream error: stream ID 1; INTERNAL_ERROR; received from peer

proxy.golang.org failed 1 download; no file of the repository is involved. The job downloads modules because the setup-go cache does not hold every module that tidy and the tests need (the race job's log shows go: downloading too).

This PR adds 1 step to the verify and race jobs, after setup-go and before the gate: go mod download ... all, with up to 3 tries 10 s apart. The gate then reads the modules from the module cache. go mod download adds the sums of every module it fetches to the go.sum beside its go.mod (42 lines here), and go mod tidy -diff then fails, so the step works on a copy of the two files in $RUNNER_TEMP (-modfile). The repository's go.mod and go.sum stay as they are. The checksum database and go.sum verify the modules as before; the module source does not change.

TestGoJobsRetryTheModuleDownload (internal/workflowcheck) keeps the step in both jobs: after setup-go, before every step that reads the modules (a Makefile gate or a go command), and on a copy (-modfile). TestModuleDownloadProblemsCatchAGateFirst feeds the check each gate before the download, a download on the repository's go.sum, and none.

#242, Race detector: fixed by #214

Run 43127310696 (3d84a45, branch feat/frostyard-look) timed out in TestSettingsChangeAPreferenceAndAVaultSetting ("timed out waiting for the vault's setting"). This is #203, which #214 fixed (the test loop drew a frame after every posted function, and a setting change posts about 19). #214 merged at 2026-11-12 14:41 UTC; 3d84a45 does not contain it. No change is needed here.

Risk tier

Risk tier: 3 — CI. risk:high paths in this PR:

  • .github/workflows/ci.yml (.github/workflows/**, L2, governance). Safe: the new step only downloads Go modules into the runner's module cache, with the job's existing contents: read permission and no new action, secret or token. It writes no file of the repository (-modfile on a copy in $RUNNER_TEMP). It fails the job only when 3 tries fail, which the gate would have done too. No job is renamed (the required-checks ruleset matches job names).
  • internal/workflowcheck/workflows_test.go (L2, the tests that hold the workflows). Safe: it adds 1 test and changes none.

Verification

  • make ci green (host and nsl) at 6d751a5, before the first push. The review fix f687dfd (the test file only): go test ./internal/workflowcheck ok, go vet and golangci-lint clean.
  • The step's command, run as the job runs it (RUNNER_TEMP a temp directory): exit 0; git status shows no change to go.mod or go.sum; go mod tidy -diff exit 0. With go mod download all on the repository's own files instead: 42 lines added to go.sum, and tidy fails.
  • Revert test: with the step taken out of the race job, TestGoJobsRetryTheModuleDownload fails: ci.yml: the race job has no step that retries .... With -modfile taken out of the verify job's step, it fails: ci.yml:43: the verify job's download writes the repository's go.sum .... The test checks 2 jobs.
  • flaky: Run go test -race -timeout 25m ./... (ci.yml / Race detector) #242: go test -race -count=30 -run '^TestSettingsChangeAPreferenceAndAVaultSetting$' ./internal/desktop/window on main: ok (27 s).
  • Workflows changed: no new action; permissions unchanged; checkout keeps persist-credentials: false.

Cross-review

Reviewer openai/gpt-6.1-sol; coder deepseek/deepseek-flash (first draft) and anthropic/claude-opus-5-5 (the -modfile step and the test). Base 7f1b8d1bb53fc5fd6e50dde26d5af0c0bb4ab598. Both risk:high paths read first.

  • Initial review at 6d751a5e1c5fd9a6423125577ccd45c614223a5c: Ready, Blocking: none. 1 low, non-blocking finding: the order check knew only make verify and go test, so a gate moved to make ci or make check could run before the download.
  • Fix f687dfd: the check matches every Makefile gate and the go commands that read modules, with a negative test.
  • Re-review 1 at f687dfd40a07479aed3810e2c43a8215b101abea: Ready, Blocking: none; the finding is resolved.

proxy.golang.org failed one download of the verify job with
"stream error: stream ID 1; INTERNAL_ERROR" during go mod tidy -diff,
and the setup-go cache did not hold the module. The verify and race
jobs now download the whole build list first, with up to 3 tries, on a
copy of go.mod and go.sum (-modfile), so the repository's go.sum stays
as tidy wants it. TestGoJobsRetryTheModuleDownload keeps the step.

Fixes #243.
@github-actions github-actions Bot added level:L2 Read the diff risk:high Touches a path in .github/risk-paths.json labels Nov 16, 2026
The order check knew only make verify and go test, so a job that moved
its gate to make ci or make check could run it before the download and
pass. The check now matches the Makefile's gates and the go commands
that read modules, and TestModuleDownloadProblemsCatchAGateFirst feeds
it each gate before the download, a download on the repository's
go.sum, and none.

Part of #243.
@frostyard-machines frostyard-machines added the ready-for-human Reviewed, CI green: ready for Brian to review and merge label Nov 16, 2026
@bketelsen
bketelsen merged commit f1958e1 into main Nov 16, 2026
12 checks passed
@bketelsen
bketelsen deleted the irulan/flaky-242-243 branch November 16, 2026 19:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

level:L2 Read the diff ready-for-human Reviewed, CI green: ready for Brian to review and merge risk:high Touches a path in .github/risk-paths.json

Projects

None yet

Development

Successfully merging this pull request may close these issues.

flaky: Tidy, vet, format, lint and unit tests (ci.yml / Verify (make verify))

2 participants