Skip to content

Resolve #2873: Remove runtime test port reservation race - #2899

Merged
ayden94 merged 1 commit into
mainfrom
issue-2873-remove-port-reservation-race
Aug 3, 2026
Merged

Resolve #2873: Remove runtime test port reservation race#2899
ayden94 merged 1 commit into
mainfrom
issue-2873-remove-port-reservation-race

Conversation

@ayden94

@ayden94 ayden94 commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Summary

Remove the reserve-close-rebind race from the runtime in-flight shutdown network test by letting the application bind an OS-assigned port directly.

Linked context: #2873

Closes #2873

Changes

  • Configure the cited Node runtime test with port: 0 instead of reserving and releasing a port first.
  • Resolve the bound NodeHttpApplicationAdapter after listen() and read the actual server address for the test request.
  • Release the blocked response and close the application in finally so assertion failures cannot leave shutdown waiting indefinitely.
  • Keep the shared reservation helper and its unrelated call sites unchanged.

Testing

  • Focused in-flight shutdown test: 1 passed.
  • Repeated focused flake check: 20/20 passed.
  • pnpm --filter @fluojs/runtime typecheck - passed.
  • pnpm --filter @fluojs/runtime test - 29 files, 311 tests passed.
  • Biome check - passed.
  • LSP diagnostics - no errors or warnings; only pre-existing deprecation hints in the test file.
  • git diff --check HEAD^..HEAD - passed.

Release impact

  • This PR has consumer-visible release impact and includes a changeset.
  • This PR has no consumer-visible release impact.

No Changeset is required because this changes only test setup and cleanup; published runtime behavior, API surface, and package contents are unchanged.

Public export documentation

  • Not applicable: no public exports or source documentation changed.

Behavioral contract

  • No documented behavioral contract changed.
  • The existing in-flight shutdown assertion remains intact while its network setup is made race-free.
  • Production runtime source is unchanged.

Platform consistency governance (SSOT)

  • Not applicable: no platform contract, adapter implementation, governance document, or conformance claim changed.

@ayden94
ayden94 merged commit b0169bd into main Aug 3, 2026
10 checks passed
@ayden94
ayden94 deleted the issue-2873-remove-port-reservation-race branch August 3, 2026 10:54
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.

[audit][area:foundation] Remove port reservation race from runtime tests (P2)

1 participant