Skip to content

Used Port 0 to fix issue #7393 #7607

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

Closed
wants to merge 4 commits into from
Closed

Conversation

satyampsoni
Copy link
Contributor

@satyampsoni satyampsoni commented Jan 22, 2024

Fixes #7393

Copy link

knative-prow bot commented Jan 22, 2024

Welcome @satyampsoni! It looks like this is your first PR to knative/eventing 🎉

Copy link

knative-prow bot commented Jan 22, 2024

Hi @satyampsoni. Thanks for your PR.

I'm waiting for a knative member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@knative-prow knative-prow bot requested review from Cali0707 and creydr January 22, 2024 08:18
@knative-prow knative-prow bot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jan 22, 2024
@creydr
Copy link
Member

creydr commented Jan 22, 2024

/ok-to-test

@knative-prow knative-prow bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Jan 22, 2024
Copy link
Member

@creydr creydr left a comment

Choose a reason for hiding this comment

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

Thanks for working on this.
I left a comment.

Can you later also change it for the other tests using a hard coded port?

destination := duckv1.Addressable{
URL: apis.HTTPS("localhost:8334"),
URL: apis.HTTPS(fmt.Sprintf("localhost:%d", destinationCA.Port())),
Copy link
Member

Choose a reason for hiding this comment

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

@satyampsoni destinationCA is a string value (containing the CA cert of the server) and does not have a Port() method.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hi @creydr

Thank you for your feedback on the code review. I noticed the issue with using Port() on destinationCA. To address this, I'm planning to use a separate variable, let's call it destinationPort, to hold the dynamically assigned port.

Before proceeding, I wanted to confirm the availability of the destinationPort variable. Could you please let me know if such a variable is already present in the codebase or if there is a recommended method for obtaining the dynamically assigned port?

Your clarification on this matter will help me ensure that I'm addressing the issue correctly.

Copy link
Member

@creydr creydr Jan 22, 2024

Choose a reason for hiding this comment

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

Before proceeding, I wanted to confirm the availability of the destinationPort variable. Could you please let me know if such a variable is already present in the codebase ...

Not sure, what you're trying to achieve 🤔 Can you give a bit more context here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure
In my PR there is an issue with using Port() on destinationCA, and I'm working to address this by dynamically obtaining the assigned port. I plan to introduce a variable, destinationPort, to hold this information when constructing the URL.
I'm interested in confirming if there is an existing variable similar to destinationPort that is commonly used for holding dynamically assigned ports in our tests. Additionally, if there are any recommended patterns or best practices for obtaining the port dynamically, I would like to align with those.

Copy link
Member

Choose a reason for hiding this comment

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

Ah ok I think I understand you now. I am not aware of a similar var to destinationPort. Anyhow I would rather update the StartServer() to return the port too.

@knative-prow knative-prow bot added size/M Denotes a PR that changes 30-99 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Jan 23, 2024
Copy link

knative-prow bot commented Jan 23, 2024

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: satyampsoni
Once this PR has been reviewed and has the lgtm label, please ask for approval from creydr. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@satyampsoni
Copy link
Contributor Author

satyampsoni commented Jan 23, 2024

/retest

@satyampsoni
Copy link
Contributor Author

/retest-required

@satyampsoni
Copy link
Contributor Author

/retest

Copy link

knative-prow bot commented Jan 24, 2024

@satyampsoni: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
unit-tests_eventing_main 1e7aa11 link true /test unit-tests

Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@creydr
Copy link
Member

creydr commented Feb 6, 2024

@satyampsoni any updates on this? Do you need help with this?

@satyampsoni
Copy link
Contributor Author

@creydr yep,
How to fix this?
image

@creydr
Copy link
Member

creydr commented Feb 9, 2024

@creydr yep, How to fix this? image

This seems to be, as you simply return the given port to StartServer() in https://github.com/knative/eventing/pull/7607/files#diff-19e24bc260761850cf90ace03ff2291a969d7e008a6e555fb09d2728ee94fbd2R87. Anyhow you need to use the "real" port. Port 0 indicates simply to use the next available port.
When you start the server in receiver.StartListen(), you should be able to get the real port somehow.

@satyampsoni
Copy link
Contributor Author

Thanks for the help. Have looked into it. I'll correct it once my exams are over after 12 Feb.

@Cali0707
Copy link
Member

Hi @satyampsoni any updates? Can I help here?

@pierDipi
Copy link
Member

@satyampsoni are you still working on this one?

@pierDipi
Copy link
Member

pierDipi commented Apr 8, 2024

Closing this PR for now

@pierDipi pierDipi closed this Apr 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[flaky] pkg/kncloudevents.TestDispatchMessageToTLSEndpoint
4 participants