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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃尡 Add integration test to avoid manager.Start deadlocks #2418

Merged
merged 2 commits into from Jul 25, 2023

Conversation

sbueringer
Copy link
Member

@sbueringer sbueringer commented Jul 23, 2023

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jul 23, 2023
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jul 23, 2023
@sbueringer
Copy link
Member Author

cc @alvaroaleman

pkg/manager/integration/manager_test.go Outdated Show resolved Hide resolved
pkg/manager/integration/manager_test.go Outdated Show resolved Hide resolved
pkg/manager/integration/manager_test.go Outdated Show resolved Hide resolved
Comment on lines 251 to 252
// Read the unexported healthProbeListener field of the manager to get the listener address.
// This is a hack but it's better than using a hard-coded port.
Copy link
Member

Choose a reason for hiding this comment

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

Is the listening address not exposed in any other way? Could we avoid relying on reflection to get a private value?

Copy link
Member Author

Choose a reason for hiding this comment

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

I couldn't find another way. The problem is that I don't have access to private fields.

I couldn't put this test in the manager package because of cyclic dependencies (and it's probably also better as an integration test if it's outside of the package).

Happy to change it if there is an alternative. I couldn't find any apart from exporting something in the Manager that we probably don't want to export

pkg/manager/integration/manager_test.go Outdated Show resolved Hide resolved
pkg/manager/integration/manager_test.go Outdated Show resolved Hide resolved
pkg/manager/integration/manager_test.go Outdated Show resolved Hide resolved
@sbueringer
Copy link
Member Author

sbueringer commented Jul 24, 2023

Should be all addressed/answered now. I moved the test below internal. While the _test.go didn't "leak" any exported types the v1/v2 packages did.

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jul 25, 2023
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: sbueringer, 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:
  • OWNERS [sbueringer,vincepri]

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

@sbueringer
Copy link
Member Author

unrelated flake

/retest

@k8s-ci-robot k8s-ci-robot merged commit cc1862e into kubernetes-sigs:main Jul 25, 2023
9 checks passed
@sbueringer sbueringer deleted the pr-mgr-deadlock-test branch July 25, 2023 16:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Improve test coverage for controller startup with conversion
3 participants