Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix integration tests for Windows #16693

Merged
merged 7 commits into from
Feb 20, 2025
Merged

Fix integration tests for Windows #16693

merged 7 commits into from
Feb 20, 2025

Conversation

philipp-spiess
Copy link
Member

@philipp-spiess philipp-spiess commented Feb 20, 2025

The Nuxt preview server always starts on port 3000 even if that port is taken. With the added tests in #16631 there is now a higher chance these ports are already taken since e.g. react router prefers to start at port 3000 and so do other servers.
This PR changes this so that we assign a random port inside the test instead.

Test plan

  • Ensure Windows CI is green again

@philipp-spiess philipp-spiess marked this pull request as ready for review February 20, 2025 16:03
@philipp-spiess philipp-spiess requested a review from a team as a code owner February 20, 2025 16:03
Comment on lines 593 to 599
export function getFreePort(): number {
let server = net.createServer()
server.listen(0)
let address = server.address() as net.AddressInfo
server.close()
return address.port
}
Copy link
Member

Choose a reason for hiding this comment

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

NOOOOOO 😭

@philipp-spiess philipp-spiess merged commit 1d56525 into main Feb 20, 2025
5 checks passed
@philipp-spiess philipp-spiess deleted the fix/windows-ci branch February 20, 2025 16:50
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