Skip to content

Fix race condition when starting a local registry#40797

Open
OneBlue wants to merge 1 commit into
masterfrom
user/oneblue/fix-test-9
Open

Fix race condition when starting a local registry#40797
OneBlue wants to merge 1 commit into
masterfrom
user/oneblue/fix-test-9

Conversation

@OneBlue

@OneBlue OneBlue commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

Summary of the Pull Request

This change solves a timing issue by actually waiting for the newly created local registry to have the port bound before returning so the caller can immediately call into the registry

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

Validation Steps Performed

Copilot AI review requested due to automatic review settings June 12, 2026 23:01

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

This PR addresses flaky timing when starting the wslc-registry:latest test registry by centralizing registry startup logic in the shared e2e helpers and adding an explicit readiness wait before callers proceed.

Changes:

  • Refactors StartLocalRegistry in the SDK tests (WinRT + COM) to delegate to WSLCE2ETests::StartLocalRegistry.
  • Updates the shared WSLCE2ETests::StartLocalRegistry helper to wait for the registry init process to emit a “listening” message before continuing.
  • Adds the shared helper header include to the affected test files.

Reviewed changes

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

File Description
test/windows/WslcSdkWinRTTests.cpp Delegates local registry startup to the shared e2e helper for consistent readiness behavior.
test/windows/WslcSdkTests.cpp Delegates local registry startup to the shared e2e helper for consistent readiness behavior.
test/windows/wslc/e2e/WSLCE2EHelpers.cpp Adds a pre-return readiness wait (based on init process output) to reduce registry startup race/flakiness.

@OneBlue OneBlue marked this pull request as ready for review June 12, 2026 23:49
@OneBlue OneBlue requested a review from a team as a code owner June 12, 2026 23:49
@OneBlue OneBlue enabled auto-merge (squash) June 13, 2026 00:29
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