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

Get correct leader election holder ID in upgrade test #1994

Merged
merged 2 commits into from
May 22, 2024

Conversation

ciarams87
Copy link
Member

Proposed changes

Problem: The upgrade NFR test is not working.

Solution: The issue is around the leader election lease holder ID not being equal to one of the upgraded pod names, which is what the test expects. Instead, the holder ID is in the format <pod-name_uid>. The fix is to split the holder ID on the underscore, and then instead make sure the first part of the string matches one of the upgraded pod names.

Also added defer GinkgoRecover() so that Ginkgo handles its internal panic correctly when an assertion fails within this nested function. See https://onsi.github.io/ginkgo/#mental-model-how-ginkgo-handles-failure for more info.

Testing: Ran the test locally and confirmed it now passes successfully.

Closes #1891

Checklist

Before creating a PR, run through this checklist and mark each as complete.

  • I have read the CONTRIBUTING doc
  • I have added tests that prove my fix is effective or that my feature works
  • I have checked that all unit tests pass after adding my changes
  • I have updated necessary documentation
  • I have rebased my branch onto main
  • I will ensure my PR is targeting the main branch and pulling from my branch from my own fork

Release notes

If this PR introduces a change that affects users and needs to be mentioned in the release notes,
please add a brief note that summarizes the change.

NONE

@ciarams87 ciarams87 requested a review from a team as a code owner May 20, 2024 15:16
@github-actions github-actions bot added the tests Pull requests that update tests label May 20, 2024
@bjee19
Copy link
Contributor

bjee19 commented May 20, 2024

I mentioned possibly re-running the other automated tests to see if they are still functioning correctly in the linked issue, do you think that would be unnecessary / out of scope for this issue?

@ciarams87
Copy link
Member Author

I mentioned possibly re-running the other automated tests to see if they are still functioning correctly in the linked issue, do you think that would be unnecessary / out of scope for this issue?

@bjee19 I'll rerun the whole suite and open tickets if there are any other failures 👍🏼

Copy link
Contributor

@salonichf5 salonichf5 left a comment

Choose a reason for hiding this comment

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

lgtm

@bjee19
Copy link
Contributor

bjee19 commented May 20, 2024

Thanks @ciarams87! If you could list the tests you re-ran somewhere I think that'll be good to have verified at least. You're probably not going to do the extended duration tests, so knowing which ones you did I think would be good for release time.

tests/suite/upgrade_test.go Outdated Show resolved Hide resolved
Copy link

codecov bot commented May 22, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.00%. Comparing base (206f136) to head (1eb63f4).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1994      +/-   ##
==========================================
+ Coverage   87.66%   95.00%   +7.33%     
==========================================
  Files          93        1      -92     
  Lines        6557      220    -6337     
  Branches       50       50              
==========================================
- Hits         5748      209    -5539     
+ Misses        753       11     -742     
+ Partials       56        0      -56     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@ciarams87 ciarams87 requested a review from bjee19 May 22, 2024 14:34
@ciarams87 ciarams87 merged commit 082e63e into nginxinc:main May 22, 2024
40 checks passed
@ciarams87 ciarams87 deleted the tests/fix-upgrade-test branch May 22, 2024 15:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tests Pull requests that update tests
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Automated upgrade test fails
4 participants