Skip to content

Fix flaky E2E network list test assertion - #41009

Merged
beena352 merged 3 commits into
microsoft:masterfrom
beena352:user/beenachauhan/fix/wslce2e-network-list-flake
Jul 9, 2026
Merged

Fix flaky E2E network list test assertion#41009
beena352 merged 3 commits into
microsoft:masterfrom
beena352:user/beenachauhan/fix/wslce2e-network-list-flake

Conversation

@beena352

@beena352 beena352 commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

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

  • Closes: Link to issue #xxx
  • Communication: I've discussed this with core contributors already. If work hasn't been agreed, this work might be rejected
  • Tests: Added/updated if needed and all pass
  • Localization: All end user facing strings can be localized
  • Dev docs: Added/updated if needed
  • Documentation updated: If checked, please file a pull request on our docs repo and link it here: #xxx

Detailed Description of the Pull Request / Additional comments

The WSLCE2E_Network_List_JsonFormat test intermittently fails with Values (2, 3) because WSLCE2E_Inspect_Image_PriorityOverNetwork creates a network named "debian" (DebianImage.Name) that isn't covered
by 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

Copilot AI review requested due to automatic review settings July 6, 2026 20:18

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

@beena352
beena352 marked this pull request as ready for review July 6, 2026 20:21
@beena352
beena352 requested a review from a team as a code owner July 6, 2026 20:21

@OneBlue Blue (OneBlue) left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we know where the leak is coming from ? Ideally we should fix the leak so this doesn't potentially cause other failures

Copilot AI review requested due to automatic review settings July 8, 2026 23:26

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

EnsureContainerDoesNotExist(WslcContainerName);
EnsureContainerDoesNotExist(DebianImage.Name);
EnsureNetworkDoesNotExist(WslcNetworkName);
EnsureNetworkDoesNotExist(DebianImage.Name);

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This doesn't look right. We're looking for a network but passing in an image name

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok I see what's happening from the description. Sorry for misunderstanding, I got a bit confused reading this !

@beena352
beena352 merged commit a4403c1 into microsoft:master Jul 9, 2026
9 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.

3 participants