Skip to content

Support ephemeral ports in dev server and allow cURL tests to parallelize #6132

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

Closed
wants to merge 2 commits into from

Conversation

sgolemon
Copy link
Member

Attempting to listen on port 0 instructs the kernel to select an unused port to listen on, which we can then query back out to userspace.

The CLI dev server already has most of the machinery to do this, we just need to allow specifying port zero (or assuming port zero if no port is present). The first commit in this stack does that.

The second commit in this stack updates ext/curl/tests/server.inc to parse the listening port out of the log statements so that we can run all curl tests in parallel with each other (and any other phpt).

@sgolemon sgolemon requested review from nikic and cmb69 September 14, 2020 20:53
@sgolemon sgolemon force-pushed the sgolemon.ephemeral-ports branch from 1de4f78 to 6a04cc1 Compare September 14, 2020 21:01
@sgolemon
Copy link
Member Author

Targetting 8.1 btw. Much as I'd love the speedup on my test runs, this can wait.

@sgolemon sgolemon force-pushed the sgolemon.ephemeral-ports branch from 6a04cc1 to 9b4cac9 Compare September 15, 2020 14:54
Copy link
Member

@nikic nikic left a comment

Choose a reason for hiding this comment

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

This looks good to me. I think this is also fine for PHP 8.0, the user-facing change here is pretty minimal.

Copy link
Member

@cmb69 cmb69 left a comment

Choose a reason for hiding this comment

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

Thanks, that's a really nice performance improvement for testing!

@sgolemon
Copy link
Member Author

Push as a61a9fe and bfa8e42.

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