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

CP/DP Split: Update functional tests #3207

Merged
merged 8 commits into from
Mar 23, 2025

Conversation

bjee19
Copy link
Contributor

@bjee19 bjee19 commented Mar 11, 2025

Proposed changes

Update functional tests for the control plane data plane split.

Problem: The functional tests do not pass with the current architecture.

Solution: Add updates to functional tests, notable changes made:

  • Collector collects regardless if latest configuration is nil. This is needed because if NGF is deployed without a gateway, the collector will throw an error since no nginx configuration has been made. This only affects endpoint count.

Bugs fixed:

  • If a gateway was deployed with multiple listeners with different ports, it resulted in multiple nginx instances being created and subsequently terminated while NGF stayed in a continuous loop. This was because when we build our NGINX conf, we had a couple of fields which were processed by ranging over a map. Since ranging over a map in Golang results in a random order traversal, it meant that given a set input, the built nginx conf could have many different outcomes. Thus when processing resources we would continuously update nginx even though nothing had changed. Fixed by sorting the fields which are built by ranging over a map so that the outcomes would be deterministic.
  • NGF would fail to delete a provisioned gateway in the following scenario.
  1. Deploy NGF and a gateway
  2. Delete NGF Pod.
  3. Before NGF becomes leader, but a couple seconds after NGF had processed resources upon startup delete the gateway.

Fixed by tracking gateway delete event when NGF is not leader.

Opened bug: #3248

Closes part of #3010

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

@github-actions github-actions bot added the tests Pull requests that update tests label Mar 11, 2025
@bjee19
Copy link
Contributor Author

bjee19 commented Mar 11, 2025

Functional tests pass locally, opening PR to run them in the pipeline

@bjee19 bjee19 marked this pull request as ready for review March 11, 2025 22:47
@bjee19 bjee19 requested a review from a team as a code owner March 11, 2025 22:47
Copy link

codecov bot commented Mar 11, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.96%. Comparing base (6337c97) to head (5bf9d66).
Report is 182 commits behind head on change/control-data-plane-split.

Additional details and impacted files
@@                         Coverage Diff                         @@
##           change/control-data-plane-split    #3207      +/-   ##
===================================================================
- Coverage                            89.74%   86.96%   -2.79%     
===================================================================
  Files                                  109      121      +12     
  Lines                                11150    13739    +2589     
  Branches                                50       62      +12     
===================================================================
+ Hits                                 10007    11948    +1941     
- Misses                                1083     1672     +589     
- Partials                                60      119      +59     

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@bjee19 bjee19 marked this pull request as draft March 11, 2025 23:28
@bjee19 bjee19 marked this pull request as ready for review March 12, 2025 21:14
@bjee19 bjee19 force-pushed the tests/update-tests-for-cp-dp branch from efa75dd to 16c230d Compare March 18, 2025 19:15
@bjee19 bjee19 force-pushed the tests/update-tests-for-cp-dp branch from 16c230d to 95379ec Compare March 18, 2025 19:18
@bjee19 bjee19 changed the title CP/DP Split: Update functional and non-functional tests CP/DP Split: Update functional tests Mar 18, 2025
@bjee19 bjee19 requested a review from sjberman March 20, 2025 21:12
@bjee19 bjee19 merged commit a9f53ec into change/control-data-plane-split Mar 23, 2025
29 of 37 checks passed
@bjee19 bjee19 deleted the tests/update-tests-for-cp-dp branch March 23, 2025 02:15
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
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants