-
Notifications
You must be signed in to change notification settings - Fork 205
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
Conversation
The test was marked exclusive because it required access to port 6865. However, the test-runner now automatically chooses a free port at runtime.
There was a problem hiding this 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. |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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 👍
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
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
CHANGELOG_BEGIN
andCHANGELOG_END
tags, if appropriateNOTE: CI is not automatically run on non-members pull-requests for security
reasons. The reviewer will have to comment with
/AzurePipelines run
totrigger the build.