Skip to content

Fix integration tests for Windows#16693

Merged
philipp-spiess merged 7 commits intomainfrom
fix/windows-ci
Feb 20, 2025
Merged

Fix integration tests for Windows#16693
philipp-spiess merged 7 commits intomainfrom
fix/windows-ci

Conversation

@philipp-spiess
Copy link
Contributor

@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