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

tests: introduce a compiler flag to enable ephemeral ports #129

Merged
merged 1 commit into from
Dec 28, 2018

Conversation

pushkarnk
Copy link
Contributor

@pushkarnk pushkarnk commented Dec 28, 2018

Owing to a limitation in ClientRequest, the use of ephemeral ports needs configuration of the ephemeral port range. This configuration is done using the sysctl command on both Linux and macOS. While sysctl appears to be working without sudo permissions on Linux, it needs sudo on macOS. This forces swift test to stop at the password prompt. This behaviour change needs to be avoided. This commit makes the use of ephemeral ports optional by introducing a compiler flag called USE_EPHEMERAL_PORTS.

To run Kitura-NIO tests with ephemeral ports issue: swift test -Xswiftc -DUSE_EPHEMERAL_PORTS

On Travis CI, we could continue using ephemeral ports on both macOS and Linux. For this, the .swift-test-macOS and .swift-test-linux are added.

Owing to a limitation in ClientRequest, the use of ephemeral ports needs configuration of the ephemeral port range. This configuration is done using the `sysctl` command on both Linux and macOS. While sysctl appears to be working without sudo permissions on Linux, it needs sudo on macOS. This forces `swift test` to stop at the password prompt. This behaviour change needs to be avoided. This commit makes the use of ephemeral ports optional by introducing a compiler flag called `USE_EPHEMERAL_PORTS`.

To run Kitura-NIO tests with ephemeral ports issue: `swift test -Xswiftc -DUSE_EPHEMERAL_PORTS

On Travis CI, we could continue using ephemeral ports on both macOS and Linux. For this, the `.swift-test-macOS` and `.swift-test-linux` are added.
@pushkarnk pushkarnk merged commit d3c5a9e into Kitura:master Dec 28, 2018
@pushkarnk pushkarnk deleted the ephemeral-flag branch May 26, 2020 07:48
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.

1 participant