Skip to content

fix(ci): eliminate chronic E2E timeout — Runtime.Close Docker-verify waste - #478

Merged
Dumbris merged 2 commits into
mainfrom
fix/runtime-close-docker-verify-ci-timeout
May 18, 2026
Merged

Dumbris merged 2 commits into
mainfrom
fix/runtime-close-docker-verify-ci-timeout

Conversation

@Dumbris

@Dumbris Dumbris commented May 18, 2026

Copy link
Copy Markdown
Member

Problem

E2E Tests has failed on every main commit for weeks (v0.31.0/v0.31.1 shipped through it). Root-caused: Runtime.Close() and Server.Stop() unconditionally ran a Docker container-cleanup verification — a docker ps probe + a 15×1s poll loop + 2s sleep (~17 s) — even when no Docker isolation was ever used. Every runtime-constructing unit test paid ~17 s in t.Cleanup; across ~dozens of tests under -race the internal/runtime package hung >12 min, blowing the -race -timeout 2m step. Not caused by any recent feature — pure pre-existing infra rot.

Fix

  • Manager.UsesDockerIsolation() (same predicate as the Docker recovery monitor) gates both cleanup-verification blocks. No isolation ⇒ no managed containers ⇒ nothing to verify. Production behavior with Docker isolation is unchanged.
  • testing.Short() guards on the heaviest property/timing tests (TestRapidQuarantineStateMachine ~270 s, TestRapidInvariant_* ~70 s, five ~18 s timing tests).
  • E2E fast unit step now -short -timeout 4m; the guarded heavy tests run unguarded in the main-only stress-tests job so invariant coverage is preserved.

Result (local, exact CI condition -short -race -timeout 2m)

Package Before After
internal/runtime hang >12 min ok 20 s
internal/server slow ok 18 s
internal/upstream — ok 2.3 s
internal/contracts — ok

Related #468

Dumbris added 2 commits May 18, 2026 17:50
Root cause of the chronic E2E red (failing on every main commit for
weeks; v0.31.0/.1 shipped through it): Runtime.Close() and
Server.Stop() always ran a Docker container-cleanup verification —
a docker ps probe + a 15x1s poll loop + 2s sleep (~17s) — even when
no Docker isolation was ever used. Every runtime-constructing unit
test paid ~17s in t.Cleanup; across ~dozens of tests under -race the
internal/runtime package hung past 12 min, blowing CI's
-race -timeout 2m step.

Fix: add Manager.UsesDockerIsolation() (same predicate as the Docker
recovery monitor) and gate both cleanup-verification blocks on it.
No isolation => no managed containers => nothing to verify. Production
behavior with Docker isolation is unchanged.

Also add testing.Short() guards to the heaviest property/timing tests
(TestRapidQuarantineStateMachine ~270s, TestRapidInvariant ~70s, and
five ~18s timing tests) so the fast unit step stays lean; they still
run in the main-only stress-tests job.

Result (local, exact CI condition -short -race -timeout 2m):
- internal/runtime: hang >12m  -> ok 20s
- internal/server:  slow       -> ok 18s
- internal/upstream/contracts: ok

Related #468
Pairs with the Runtime.Close Docker-verify fix. The fast unit step
now passes -short (activating the testing.Short guards) with a 4m
race timeout for headroom; the heavy property/timing tests run
unguarded in the main-only stress-tests job so coverage is preserved.

Related #468
@cloudflare-workers-and-pages

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown
Contributor

📦 Build Artifacts

Workflow Run: View Run
Branch: fix/runtime-close-docker-verify-ci-timeout

Available Artifacts

  • archive-darwin-amd64 (26 MB)
  • archive-darwin-arm64 (23 MB)
  • archive-linux-amd64 (15 MB)
  • archive-linux-arm64 (13 MB)
  • archive-windows-amd64 (26 MB)
  • archive-windows-arm64 (23 MB)
  • frontend-dist-pr (0 MB)
  • installer-dmg-darwin-amd64 (20 MB)
  • installer-dmg-darwin-arm64 (18 MB)

How to Download

Option 1: GitHub Web UI (easiest)

  1. Go to the workflow run page linked above
  2. Scroll to the bottom "Artifacts" section
  3. Click on the artifact you want to download

Option 2: GitHub CLI

gh run download 26041263822 --repo smart-mcp-proxy/mcpproxy-go

Note: Artifacts expire in 14 days.

@Dumbris
Dumbris merged commit 70bf68c into main May 18, 2026
23 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.

1 participant