Try fixing flaky network test - #304
Draft
majst01 wants to merge 1 commit into
Draft
Conversation
majst01
force-pushed
the
fix-flaky-network-test
branch
from
September 3, 2026 05:54
032b381 to
8086de3
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #304 +/- ##
==========================================
- Coverage 79.93% 79.90% -0.03%
==========================================
Files 199 199
Lines 14800 14800
==========================================
- Hits 11830 11826 -4
- Misses 2969 2973 +4
Partials 1 1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Description
test-network often fails with the same error, asking deepseek for potential fix came up with this one.
TBH i do not yet fully understand the fix :-(
Explanation:
What changed: The "ensure parent prefix exists in ipam" loop was hoisted out of the if namespace != nil block so it now runs for both namespaced and non-namespaced super networks. CreateNamespace still only runs for the namespaced case; then, for every parent prefix of the requested family, it does a GetPrefix and, if missing (NotFound), a CreatePrefix in the target namespace (the default root namespace for non-namespaced supers).
Why this fixes the flake: Previously, for a non-namespaced super, createChildPrefix called AcquireChildPrefix directly and relied on the parent prefix having been created earlier. go-ipam's AcquireChildPrefix maps a missing parent to InvalidArgument, not NotFound, so the errorutil.IsNotFound(err) { continue } guard never caught it — a transiently missing parent (e.g. from DeleteNetworks resetting ipam state between the sequential subtests) surfaced as the reported internal: NotFound prefix not found. Now the parent is deterministically materialized before allocation, independent of prior ipam state.
Used AI-Tools ✨