-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
🌱 RuntimeSDK/client: use random port for unit test server #6665
🌱 RuntimeSDK/client: use random port for unit test server #6665
Conversation
3af8a86
to
e908084
Compare
@@ -530,7 +528,8 @@ func TestClient_CallExtension(t *testing.T) { | |||
validExtensionHandlerWithFailPolicy := runtimev1.ExtensionConfig{ | |||
Spec: runtimev1.ExtensionConfigSpec{ | |||
ClientConfig: runtimev1.ClientConfig{ | |||
URL: pointer.String(fmt.Sprintf("https://%s/", testHostPort)), | |||
// Set a dummy URL, in test cases where we start the test server the URL will be overridden. |
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.
// Set a dummy URL, in test cases where we start the test server the URL will be overridden. | |
// Set a fake URL, in test cases where we start the test server the URL will be overridden. |
@@ -552,7 +551,8 @@ func TestClient_CallExtension(t *testing.T) { | |||
validExtensionHandlerWithIgnorePolicy := runtimev1.ExtensionConfig{ | |||
Spec: runtimev1.ExtensionConfigSpec{ | |||
ClientConfig: runtimev1.ClientConfig{ | |||
URL: pointer.String(fmt.Sprintf("https://%s/", testHostPort)), | |||
// Set a dummy URL, in test cases where we start the test server the URL will be overridden. |
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.
// Set a dummy URL, in test cases where we start the test server the URL will be overridden. | |
// Set a fake URL, in test cases where we start the test server the URL will be overridden. |
@@ -780,7 +781,8 @@ func TestClient_CallAllExtensions(t *testing.T) { | |||
extensionConfig := runtimev1.ExtensionConfig{ | |||
Spec: runtimev1.ExtensionConfigSpec{ | |||
ClientConfig: runtimev1.ClientConfig{ | |||
URL: pointer.String(fmt.Sprintf("https://%s/", testHostPort)), | |||
// Set a dummy URL, in test cases where we start the test server the URL will be overridden. |
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.
// Set a dummy URL, in test cases where we start the test server the URL will be overridden. | |
// Set a fake URL, in test cases where we start the test server the URL will be overridden. |
e908084
to
665410a
Compare
@vincepri Done, PTAL |
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.
/lgtm
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.
/approve
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: vincepri The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
What this PR does / why we need it:
I noticed that when running the tests locally I hit the issue that parallel running tests fail because the port is already used.
I assume Go only starts more tests (in this case of the same package) in parallel if the CPU core/thread count is high enough :)
But of course this also fails if something else is using the port locally which can easily happen with 9090.
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #