fix(e2e): eliminate docker network address-pool exhaustion#125
Merged
Conversation
Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
Signed-off-by: Joshua Temple <joshua.temple@stablekernel.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The e2e suite fails non-deterministically with
all predefined address pools have been fully subnetted. Each scenario creates its own docker network and the previous teardown removed it fire-and-forget. Across the serial scenario suite a leaked network drains the daemon's small default address pool until a late scenario cannot allocate one and dies at setup. It is not a timeout and not a defect in the failing scenario.A secondary symptom: a few scenarios exhausted all of the transient act-exec retries under heavy contention, even though the retry recovered several others on a later attempt.
Fix
Cleanup(). Removal now waits for and checks the result, with a short bounded retry so a container that is still detaching cannot leave the network behind. The scenario-retry layer already defersCleanup()per attempt, so every attempt (including a failed one) releases its network. The invariant: running many scenarios does not grow the docker network count.default-address-pools(10.99.0.0/16 carved into /24 subnets, 256 networks) and restarts docker before the tests. Belt and suspenders with the harness fix so brief cleanup lag cannot exhaust the pool.Verification
go build ./...,go vet ./...(e2e module), andgolangci-lint run ./e2e/...all clean.docker network lscount before and after running the multi-repo scenario plus multi-step scenarios at-parallel 1; the count returns to baseline rather than growing.