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

Bind PackageServer to ephemeral port to avoid port conflicts #227

Merged
merged 1 commit into from
Mar 13, 2024

Commits on Mar 13, 2024

  1. Bind PackageServer to ephemeral port to avoid port conflicts

    This is a comprehensive solution to the "flaky PackageServer tests"
    problem. It rules out port conflicts and imposes no limits on test
    parallelism. The same solution can be used for other test servers
    in the future.
    
    Major changes:
    - Turn `PackageServer` from a singleton into a class that is
      instantiated per test class or test method.
    - Start the server the first time its `port` property is read.
      Bind the server to an ephemeral port instead of port 12110.
    - For every test that uses `PackageServer`, pass the server port to
      `--test-port`, `HttpClient.Builder.setTestPort`, the `CliBaseOptions`
      or `ExecutorOptions` constructor, or the Gradle plugin's `testPort` property.
      Wire all of these to `RequestRewritingClient`'s `testPort` constructor parameter.
    - Enhance `RequestRewritingClient` to replace port 12110 with `testPort`
      in request URIs unless `testPort` is -1 (its default).
    - Introduce `ExecutorOptions.Builder`.
      This makes executor options more comfortable to create
      and allows to hide options such as `testPort`.
    - Deprecate the `ExecutorOptions` constructor to steer users towards the builder.
    - Get rid of `ExecutorOptions2`, which is no longer needed.
    - Clean up `EmbeddedExecutorTest` with the help of the builder.
    translatenix committed Mar 13, 2024
    Configuration menu
    Copy the full SHA
    d61e6ee View commit details
    Browse the repository at this point in the history