Skip to content

fix(plugin,ci): raise plugin-binary download + go test timeouts for large binaries - #575

Merged
smecsia merged 1 commit into
mainfrom
fix/fetcher-timeout-for-large-binaries
Nov 8, 2026
Merged

smecsia merged 1 commit into
mainfrom
fix/fetcher-timeout-for-large-binaries

Conversation

@smecsia

@smecsia smecsia commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

Summary

Two coupled timeouts bit #568 in CI: the plugin fetcher's 5-min HTTP
client cutoff and go test's 10-min per-package budget. sc-plugin-gcp
is ~230MB (pulumi-gcp + pulumi-kubernetes + google-api-go-client),
and a cold fetch on GHA hosted runners brushes up against both.

What

  • pkg/plugin/fetcher.go: raise downloadFile's HTTP client timeout
    5 min → 15 min. Named const downloadFileHTTPTimeout with the
    incident citation inline.
  • .github/workflows/{branch,branch-preview,push}.yaml: raise the
    go test ./... step's budget to -timeout 30m (matching the
    already-higher budget on test-registry-integration).

Live-caught

api PR #568 (phase 5 of the sc-plugin-gcp extraction), 2026-11-08. Two
consecutive reruns of TestScopeRegression_DamagedScopeFileFailsLintDeployAndReseal
and Test_Provision/happy_path_gcp timed out mid-download with
context deadline exceeded (Client.Timeout or context cancellation while reading body). Bumping the fixture version pin to the latest
release (v2026.11.08-d14f4da) didn't help — the binary size is the same.

Why not pre-warm cache or stub the fetcher

  • Pre-warm (add a curl step before go test): workable, but adds
    a second code path that goes stale when the fixture pin bumps. The
    timeout bump handles every version pin automatically.
  • Stub the fetcher in tests: cleanest long-term, but requires
    refactoring TestScopeRegression + Test_Provision to use a path:
    spec with a built-at-test-time stub binary — larger scope, blocks
    feat(plugin): phase 5 of sc-plugin-gcp extraction — delete in-tree GCP #568's merge. Follow-up item worth filing separately.

Test plan

…arge binaries

Two coupled changes with the same root cause: plugin binaries now carry
every cloud SDK a plugin depends on, so a modern plugin like
sc-plugin-gcp (which pulls in pulumi-gcp + pulumi-kubernetes + the
google-api-go-client stack) builds to ~230MB per platform-arch. CI
hits two concentric timeouts on a cold fetch:

1. `downloadFile`'s hard-coded 5-min `http.Client{Timeout: 5 * time.Minute}`
   (pkg/plugin/fetcher.go:205) — GHA hosted runners see ~1-2 MB/s steady-
   state to GitHub releases, which brushes up against 5 min on a 230MB
   binary.
2. `go test`'s default 10-min per-test-binary budget. The e2e package
   pkg/e2e/scopedstore spawns the pinned sc-plugin-gcp binary mid-test;
   the cold fetch eats several minutes of the 10 min just to arrive at
   the actual Test_Provision + TestScopeRegression_* logic, which then
   has no room to finish.

Live-caught 2026-11-08 on api PR #568 (phase 5 of the sc-plugin-gcp
extraction). Two consecutive reruns of
TestScopeRegression_DamagedScopeFileFailsLintDeployAndReseal and
Test_Provision/happy_path_gcp timed out mid-download with
`context deadline exceeded (Client.Timeout or context cancellation
while reading body)`. Bumping the fixture version pin to the latest
release (v2026.11.08-d14f4da) didn't help — the binary size (and
therefore the fetch time) is the same.

## What

- `pkg/plugin/fetcher.go`: raise the `downloadFile` HTTP client timeout
  from 5 min to 15 min. Named const `downloadFileHTTPTimeout` with the
  incident citation inline, so a future reader can trace the choice.
- `.github/workflows/{branch,branch-preview,push}.yaml`: raise the
  `go test ./...` step's budget from the default 10 min to `-timeout
  30m`, matching the already-higher budget on the
  `test-registry-integration` job. Inline comment references this
  commit's reasoning.

## Why not pre-warm cache or stub the fetcher

- **Pre-warm** (add a `curl` step before `go test`): workable, but adds
  a second code path that goes stale when the fixture pin bumps. The
  timeout bump handles every version pin automatically.
- **Stub the fetcher in tests**: cleanest long-term, but requires
  refactoring TestScopeRegression + Test_Provision to use a path:
  spec with a built-at-test-time stub binary — larger scope, blocks
  #568's merge. Follow-up item worth filing.

## Test plan

- [x] `go build ./...`
- [x] `go test ./pkg/plugin/...` — fetcher.go changes do not affect
  existing fetcher tests (they use path: specs or mock servers; the
  15-min client timeout applies only when real network I/O happens)
- [ ] `go test -timeout 30m ./...` on #568 should now complete —
  pin bump already in place from the previous CI rerun, this PR
  removes the timeout wall

Signed-off-by: Ilya Sadykov <smecsia@gmail.com>
@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown

Semgrep Scan Results

Repository: api | Commit: 015a21f

Check Status Details
⚠️ Semgrep Warning 11 warning(s), 15 total

Scanned at 2026-11-08 17:31 UTC

@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown

Security Scan Results

Repository: api | Commit: 015a21f

Check Status Details
✅ Secret Scan Pass No secrets detected
✅ Dependencies (Trivy) Pass 1 total (no critical/high)
✅ Dependencies (Grype) Pass 1 total (no critical/high)
📦 SBOM Generated 517 components (CycloneDX)

Scanned at 2026-11-08 17:32 UTC

@smecsia
smecsia enabled auto-merge (squash) November 8, 2026 18:11
@smecsia
smecsia merged commit 5373443 into main Nov 8, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants