Fix flaky E2E network list test assertion - #41009
Merged
beena352 merged 3 commits intoJul 9, 2026
Merged
Conversation
beena352
marked this pull request as ready for review
July 6, 2026 20:21
Blue (OneBlue)
left a comment
Collaborator
There was a problem hiding this comment.
Do we know where the leak is coming from ? Ideally we should fix the leak so this doesn't potentially cause other failures
Blue (OneBlue)
requested changes
Jul 9, 2026
| EnsureContainerDoesNotExist(WslcContainerName); | ||
| EnsureContainerDoesNotExist(DebianImage.Name); | ||
| EnsureNetworkDoesNotExist(WslcNetworkName); | ||
| EnsureNetworkDoesNotExist(DebianImage.Name); |
Collaborator
There was a problem hiding this comment.
This doesn't look right. We're looking for a network but passing in an image name
Collaborator
There was a problem hiding this comment.
Ok I see what's happening from the description. Sorry for misunderstanding, I got a bit confused reading this !
Blue (OneBlue)
approved these changes
Jul 9, 2026
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.
Summary of the Pull Request
Add missing network cleanup for DebianImage.Name in WSLCE2EInspectTests to prevent leaked networks from causing flaky count assertions in WSLCE2E_Network_List_JsonFormat.
PR Checklist
Detailed Description of the Pull Request / Additional comments
The
WSLCE2E_Network_List_JsonFormattest intermittently fails withValues (2, 3)becauseWSLCE2E_Inspect_Image_PriorityOverNetworkcreates a network named "debian" (DebianImage.Name) that isn't coveredby InspectTests' MethodSetup/ClassCleanup.
When the test process terminates abnormally (or scope_exit doesn't run), this network persists in Docker. On the next session start,
WSLCSession::RecoverExistingNetworks() re-imports any docker network with the wslc managed label, causing network list to return 3 instead of 2.
Fix: Add EnsureNetworkDoesNotExist(DebianImage.Name) to InspectTests'
MethodSetup and ClassCleanup, matching the existing pattern for
WslcNetworkName.
Validation Steps Performed
Verified the test passes locally with the fix applied