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

Fixing loadbalancer e2e test #12838

Merged
merged 1 commit into from
Oct 10, 2023
Merged

Conversation

Griffin-Sullivan
Copy link
Contributor

Modifying this test to focus more on the content host being able to get content even if the capsule it's registered to is down.

@Griffin-Sullivan Griffin-Sullivan added CherryPick PR needs CherryPick to previous branches 6.12.z Introduced in or relating directly to Satellite 6.12 AutoMerge_Cherry_Picked The cherrypicked PRs of master PR would be automerged if all checks passing 6.13.z Introduced in or relating directly to Satellite 6.13 6.14.z Introduced in or relating directly to Satellite 6.14 labels Oct 6, 2023
@Griffin-Sullivan Griffin-Sullivan requested a review from a team as a code owner October 6, 2023 14:12
@Griffin-Sullivan
Copy link
Contributor Author

trigger: test-robottelo
pytest: tests/foreman/destructive/test_capsule_loadbalancer.py::test_loadbalancer_install_package

Copy link
Contributor

@synkd synkd left a comment

Choose a reason for hiding this comment

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

I think the functionality that you added to this test makes a lot of sense; we should definitely be testing whether the load balancer is correctly proxying yum transactions to a second Capsule if the first Capsule is unavailable. However, I'm curious as to why you removed the existing functionality from the test instead of writing a new test to capture this scenario.

Before your changes, if I'm reading correctly, the test was effectively checking that the HAProxy server's round robin algorithm functions as expected with registration requests. With your changes, we're no longer testing that functionality, since the other test in this module specifies target parameters at registration time that should override the round robin algorithm.

Could you please explain your thinking a bit more regarding removing functionality vs. adding a new test?

url = f'https://{loadbalancer_setup["setup_haproxy"]["haproxy"].hostname}'
server_url = f'{url}:8443/rhsm'
base_url = f'{url}/pulp/content'

result = rhel7_contenthost.download_install_rpm(
Copy link
Contributor

Choose a reason for hiding this comment

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

Non-blocking: since you're refactoring this test, consider replacing installing the katello-ca-consumer package and registering with sub-man with registering via global registration.

@Griffin-Sullivan
Copy link
Contributor Author

trigger: test-robottelo
pytest: tests/foreman/destructive/test_capsule_loadbalancer.py::test_loadbalancer_install_package

@ehelms
Copy link

ehelms commented Oct 6, 2023

Before your changes, if I'm reading correctly, the test was effectively checking that the HAProxy server's round robin algorithm functions as expected with registration requests. With your changes, we're no longer testing that functionality, since the other test in this module specifies target parameters at registration time that should override the round robin algorithm.

Could you please explain your thinking a bit more regarding removing functionality vs. adding a new test?

This was at my recommendation. I did not feel that our tests job should be to test whether round-robin works for HAProxy and that the steps involved here are not of a real use case nature. And this test was proving flaky.

First and foremost, users care that if a host is registered that it can receive it's content no matter what is happening behind the load-balancer. Secondly, that if a host registers it will register no matter what is happening behind the load-balancer. So we could keep the registration test -- but I would opt for the same strategy of taking down a Capsule and ensuring that registration continues to work.

@Griffin-Sullivan
Copy link
Contributor Author

So we could keep the registration test -- but I would opt for the same strategy of taking down a Capsule and ensuring that registration continues to work.

We do have https://github.com/SatelliteQE/robottelo/blob/master/tests/foreman/destructive/test_capsule_loadbalancer.py#L270 so I can edit that after this.

@Griffin-Sullivan Griffin-Sullivan marked this pull request as ready for review October 6, 2023 23:06
@Griffin-Sullivan Griffin-Sullivan marked this pull request as draft October 6, 2023 23:06
@Griffin-Sullivan
Copy link
Contributor Author

trigger: test-robottelo
pytest: tests/foreman/destructive/test_capsule_loadbalancer.py::test_loadbalancer_install_package

@Griffin-Sullivan
Copy link
Contributor Author

trigger: test-robottelo
pytest: tests/foreman/destructive/test_capsule_loadbalancer.py::test_loadbalancer_install_package

@synkd
Copy link
Contributor

synkd commented Oct 9, 2023

@ehelms That makes sense to me. Thanks for the explanation.

Copy link
Contributor

@synkd synkd left a comment

Choose a reason for hiding this comment

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

ACK pending PRT results.

@Griffin-Sullivan
Copy link
Contributor Author

trigger: test-robottelo
pytest: tests/foreman/destructive/test_capsule_loadbalancer.py::test_loadbalancer_install_package

@Griffin-Sullivan Griffin-Sullivan marked this pull request as ready for review October 9, 2023 19:01
@sambible sambible merged commit 29fc81a into SatelliteQE:master Oct 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.12.z Introduced in or relating directly to Satellite 6.12 6.13.z Introduced in or relating directly to Satellite 6.13 6.14.z Introduced in or relating directly to Satellite 6.14 AutoMerge_Cherry_Picked The cherrypicked PRs of master PR would be automerged if all checks passing CherryPick PR needs CherryPick to previous branches
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants