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

daml script-test choose free port #3942

Merged
merged 2 commits into from
Jan 3, 2020
Merged

daml script-test choose free port #3942

merged 2 commits into from
Jan 3, 2020

Conversation

aherrmann-da
Copy link
Contributor

Automatically choose a free port in daml script runner. See #3918 (comment). The chosen port is exposed by the SandboxServer object and directly available to the test runner.
No longer requires the test to be marked exclusive.

Pull Request Checklist

  • Read and understand the contribution guidelines
  • Include appropriate tests
  • Set a descriptive title and thorough description
  • Add a reference to the issue this PR will solve, if appropriate
  • Include changelog additions in one or more commit message bodies between the CHANGELOG_BEGIN and CHANGELOG_END tags, if appropriate
  • Normal production system change, include purpose of change in description

NOTE: CI is not automatically run on non-members pull-requests for security
reasons. The reviewer will have to comment with /AzurePipelines run to
trigger the build.

The test was marked exclusive because it required access to port 6865.
However, the test-runner now automatically chooses a free port at
runtime.
Copy link
Contributor

@cocreature cocreature left a comment

Choose a reason for hiding this comment

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

Looks great assuming it works :) Thanks!

@@ -93,6 +93,7 @@ object TestMain extends StrictLogging {
case None =>
val (apiParameters, cleanup) = if (config.ledgerHost.isEmpty) {
val sandboxConfig = SandboxConfig.default.copy(
port = 0, // Automatically choose a free port.
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess sandbox.port points to the resolved port instead of 0? Otherwise I don’t understand how we can connect.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, exactly. The SandboxServer object exposes the selected port. So, fortunately no need for portFile or the like.

Copy link
Contributor

Choose a reason for hiding this comment

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

Great, thanks for the confirmation 👍

@aherrmann-da
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link
Contributor

Azure Pipelines successfully started running 1 pipeline(s).

@aherrmann-da aherrmann-da merged commit 20b2e22 into master Jan 3, 2020
@aherrmann-da aherrmann-da deleted the test-daml-script branch January 3, 2020 19:04
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