Skip to content

test(runtime): allocate heterogeneous silo ports at startup - #11201

Merged
ReubenBond merged 1 commit into
dotnet:mainfrom
ReubenBond:rb-11186-silo-port-collision
Sep 8, 2026
Merged

ReubenBond merged 1 commit into
dotnet:mainfrom
ReubenBond:rb-11186-silo-port-collision

Conversation

@ReubenBond

@ReubenBond ReubenBond commented Sep 8, 2026 •

Copy link
Copy Markdown
Member

Fixes #11186

The heterogeneous upgrade tests selected a consecutive gateway-port block before the cluster client connected. On Linux, the client could then receive one of the future gateway ports as its ephemeral source port; the reported failure shows the client using 49650 before the third silo attempted to bind that same gateway port.

Allocate each additional spawned silo's endpoints through the existing startSiloOnNewPort path immediately before launch. This checks the current listener set, preserves the cluster allocator's reservation tracking, and prevents delayed silo startup from consuming a port selected before client connections were established.

Microsoft Reviewers: Open in CodeFlow

Copilot AI lite review requested due to automatic review settings September 8, 2026 09: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 review overview

🟢 Approval recommended

The change is narrowly scoped to test infrastructure behavior and uses an existing StartSiloAsync option to address a known port-collision failure mode.

Review tier: Lite
Findings: None

What changed in this PR

This PR fixes a flaky failure in heterogeneous upgrade runtime tests by ensuring that additional (spawned) silo endpoints are allocated at the moment of startup, reducing the chance that the test client will temporarily consume a soon-to-be-used gateway port as its ephemeral source port.

Changes:

  • Start additional heterogeneous silos via TestCluster.StartSiloAsync(..., startSiloOnNewPort: true) so ports are allocated against the current in-use set immediately before launch.
  • Add an inline comment documenting the rationale (preventing ephemeral-port collisions with later-started gateway ports).
File Description
test/​Orleans.Runtime.Tests/​HeterogeneousSilosTests/​UpgradeTests/​UpgradeTestsBase.cs Switches additional silo startup to allocate ports at startup time to avoid port collisions during heterogeneous upgrade tests.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@ReubenBond
ReubenBond merged commit 71d8279 into dotnet:main Sep 8, 2026
72 checks passed
@ReubenBond
ReubenBond deleted the rb-11186-silo-port-collision branch September 8, 2026 16:23
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 9, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

test(runtime): track heterogeneous silo port collision

2 participants