Skip to content

test(server): relax port retry integration assertion#941

Draft
tt-a1i wants to merge 1 commit into
MoonshotAI:mainfrom
tt-a1i:fix/server-start-port-retry-test
Draft

test(server): relax port retry integration assertion#941
tt-a1i wants to merge 1 commit into
MoonshotAI:mainfrom
tt-a1i:fix/server-start-port-retry-test

Conversation

@tt-a1i

@tt-a1i tt-a1i commented Jun 20, 2026

Copy link
Copy Markdown

Summary

  • relax the startServer port-retry integration assertion so it uses the actual bound retry port
  • keep the exact retry sequence covered by the existing fake-gateway listenWithPortRetry unit test
  • clean up two lint warnings in the same test helpers

Related Issue

Fixes #937.

Tests

  • pnpm --filter @moonshot-ai/server exec vitest run test/start.test.ts
  • pnpm --filter @moonshot-ai/server exec vitest run test/start.test.ts
  • pnpm --filter @moonshot-ai/server run typecheck
  • pnpm --filter @moonshot-ai/server run build
  • pnpm exec oxlint --type-aware packages/server/test/start.test.ts --quiet
  • git diff --check

Also ran pnpm --filter @moonshot-ai/server run test; start.test.ts passed, but the package run failed in unrelated test/fs-watch.e2e.test.ts with a 5000ms timeout in AC #2: burst > 500 changes inside 200ms window -> truncated:true.

AI Assistance Disclosure

I used Codex to review the changes, sanity-check the implementation against existing patterns, and help spot potential edge cases.

@changeset-bot

changeset-bot Bot commented Jun 20, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 01bf74a

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@tomsen-ai tomsen-ai left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This matches the root cause I described in #937. The relaxed integration assertion plus the lock-file check is exactly the fix I had in mind, and the lint cleanups in the helpers are a nice addition.

One tiny suggestion: the variable is only used for hostname/port, so you could inline to avoid the extra binding, but the current version is perfectly readable.

Thanks for picking this up quickly.

@tomsen-ai tomsen-ai left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

This matches the root cause I described in #937. The relaxed integration assertion plus the lock-file check is exactly the fix I had in mind, and the lint cleanups in the helpers are a nice addition.

One tiny suggestion: the boundUrl variable is only used for hostname/port, so you could inline new URL(r.address) to avoid the extra binding, but the current version is perfectly readable.

Thanks for picking this up quickly.

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.

test(server): flaky startServer port-retry assertion under concurrent test runs

2 participants