e2e: fix test resource isolation and make standalone parallelism configurable - #14073
Conversation
docker-agent
left a comment
There was a problem hiding this comment.
Assessment: 🟢 APPROVE
This PR correctly implements two waves of e2e CI optimisations. The diff was reviewed end-to-end across all 17 changed files.
Key changes verified:
-
ServicePublishedPort— Correctly omits-fin itscompose portcall.docker compose portresolves the project purely from the daemon by thecom.docker.compose.projectlabel when-pis provided (toProjectNamereturns early,backend.Port()never reads a compose file). Thenet.SplitHostPortparse handles both IPv4 and IPv6 address formats produced by Compose.t.Fatalfcallsruntime.Goexit()so the zero-value return after it is unreachable — no silent zero-port risk. -
BuilderName— Sanitisation and 60-char truncation are correct. All five call sites pass a top-levelt(t.Name()= function name, e.g.TestBuildPlatformsWithCorrectBuildxConfig= 40 chars): the longest composed name is 56 chars, well below the truncation threshold. The resulting names are globally unique across parallel tests, compatible with Docker container-name and context-name character rules. -
IPC fixture —
ipc: "container:ipc_e2e-src"matches exactly what the test creates (projectName+"-src"="ipc_e2e-src"). The--rmflag on the source container and the finalrm -fin cleanup coexist safely because the latter's result is discarded. -
Makefile —
-parallel=$(E2E_PARALLEL_PLUGIN)and-parallel=$(E2E_STANDALONE_PARALLEL)are correctly positioned before./pkg/e2e(test flags before package).--tags=standaloneis also before the package path.TEST_FLAGSis only appended with-run/-skip, so no double-parallelissue in practice. -
Ephemeral ports — All removed fixed-port bindings (8070, 8090, 9090, 90, 95, 8080 in fixtures) have corresponding call-site updates to
ServicePublishedPortor relaxed assertions (0.0.0.0:vs0.0.0.0:8080). No residual hardcoded port numbers remain for the changed fixtures. -
Poll-delay calibrations — Raising delays from 100 ms → 500 ms–1 s reduces
compose execstorm during long-running watch polls without changing test semantics.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
fd49a3c to
f8b90f3
Compare
f8b90f3 to
75a7df2
Compare
75a7df2 to
057be6f
Compare
docker-agent
left a comment
There was a problem hiding this comment.
🟢 No issues found — LGTM! View logs.
…igurable Several e2e tests used fixed host ports (8070, 8080, 8090, etc.), global buildx builders registered with --use, and a hardcoded IPC container name. Under parallel execution these shared daemon-level resources caused port conflicts, buildkitd container-name collisions, and intermittent failures. Separately, the standalone make target hardcoded -parallel=1, forcing the entire standalone suite to run serially even though the same tests run in parallel in plugin mode. Changes: - Convert fixed host ports in four fixtures (network-test, sentences, build-test, volume-test) to ephemeral bindings; add ServicePublishedPort helper to framework.go to resolve the actual mapped port at runtime. - Give each buildx-builder test a unique daemon-scoped name via BuilderName helper, preventing container-name collisions between parallel goroutines. Applies to TestBuildPlatformsWithCorrectBuildxConfig, TestBuildPrivileged, TestBuildBuilder, TestBuildEntitlements, TestBuildTLS. - Rename the fixed ipc_mode_container to a project-scoped name (ipc_e2e-src) and update the ipc-test fixture accordingly. - Replace the hardcoded -parallel=1 in make e2e-compose-standalone with E2E_PARALLEL_PLUGIN?=4 and E2E_STANDALONE_PARALLEL?=4, aligning both modes with the effective GOMAXPROCS on 4-core GitHub Actions runners. Both variables are overridable (E2E_STANDALONE_PARALLEL=1 restores serial local debugging). - Raise the poll delay in watch_test.go long-running polls (90s/120s timeout) from the default 100ms to 1s; bump cascade_test.go and publish_test.go from 100ms to 500ms. Reduces CPU pressure without affecting effective test duration. The logging-driver fixture retains its fixed port 24224: the Docker fluentd log driver encodes fluentd-address at service-start time, making ephemeral resolution non-trivial. TestLoggingDriver is serial so there is no collision risk in practice. Signed-off-by: Guillaume Lours <glours@users.noreply.github.com>
057be6f to
797c4a3
Compare
What I did
Several e2e tests used fixed host ports (8070, 8080, 8090, etc.), global buildx
builders registered with
--use, and a hardcoded IPC container name. Underparallel execution these daemon-level resources caused port conflicts,
buildkitd container-name collisions, and intermittent failures. Separately,
make e2e-compose-standalonehardcoded-parallel=1, forcing the entirestandalone suite to run serially even though the same tests run in parallel in
plugin mode.
Changes:
network-test,sentences,build-test,volume-test) to ephemeral bindings. Add aServicePublishedPorthelper to
framework.goto resolve the actual mapped port at test runtime.BuilderNamehelper, preventing container-name collisions between parallel goroutines.
Covers
TestBuildPlatformsWithCorrectBuildxConfig,TestBuildPrivileged,TestBuildBuilder,TestBuildEntitlements,TestBuildTLS.-parallel=1inmake e2e-compose-standalonewithE2E_STANDALONE_PARALLEL?=4, aligning standalone with plugin mode on4-core GitHub Actions runners.
E2E_PARALLEL_PLUGIN?=4makes theplugin-mode knob explicit too. Both are overridable (
E2E_STANDALONE_PARALLEL=1restores serial local debugging).
watch_test.golong-running polls (90 s / 120 stimeout) from the default 100 ms to 1 s; bump
cascade_test.goandpublish_test.gofrom 100 ms to 500 ms. Timeouts are unchanged.The
logging-driverfixture keeps its fixed port 24224: the Docker fluentdlog driver encodes
fluentd-addressat service-start time, so ephemeralresolution would require a multi-step
compose up.TestLoggingDriverisserial, so there is no collision risk in practice.
Related issue
No related issue — this is a test-infrastructure improvement.
(not mandatory) A picture of a cute animal, if possible in relation to what you did
A panda who has learned not to share its bamboo with parallel neighbours 🐼