Skip to content

TPT-4206: Integration tests for NB Front-End IP & 40Gbps#664

Open
mawilk90 wants to merge 10 commits intolinode:proj/nb-front-end-ip-in-vpcfrom
mawilk90:feature/TPT-4206-sdks-add-int-tests-for-nb-front-end-ip-in-vpc
Open

TPT-4206: Integration tests for NB Front-End IP & 40Gbps#664
mawilk90 wants to merge 10 commits intolinode:proj/nb-front-end-ip-in-vpcfrom
mawilk90:feature/TPT-4206-sdks-add-int-tests-for-nb-front-end-ip-in-vpc

Conversation

@mawilk90
Copy link
Contributor

@mawilk90 mawilk90 commented Mar 10, 2026

📝 Description

Integration tests for NodeBalancer Front-End IP in VPC and 40Gbps NodeBalancer-MTC

NOTE:
There is no valid region on DevCloud to create nodebalancers of type=premium_40gb so one test will fail. I decided to do not add 'skipif' dependent on the env, because we usually do not execute tests on DevCloud

✔️ How to Test

make test-int TEST_SUITE=nodebalancer TEST_ARGS="-k test_nb_with"

@mawilk90 mawilk90 requested a review from Copilot March 10, 2026 12:44
@mawilk90 mawilk90 marked this pull request as ready for review March 10, 2026 12:44
@mawilk90 mawilk90 requested a review from a team as a code owner March 10, 2026 12:44
@mawilk90 mawilk90 requested review from ckulinsk and jriddle-linode and removed request for a team March 10, 2026 12:44
@mawilk90 mawilk90 requested review from dawiddzhafarov, ezilber-akamai and psnoch-akamai and removed request for jriddle-linode March 10, 2026 12:44
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Adds integration coverage for NodeBalancer Front-End IP behavior in VPCs (including single-stack IPv4) and validates the premium_40gb NodeBalancer type behavior.

Changes:

  • Added NodeBalancer integration tests for backend-only VPC attachment, frontend VPC IP assignment, and mixed frontend/backend VPC configurations.
  • Added new VPC fixtures for IPv4-only VPC/subnet creation to support single-stack frontend tests.
  • Updated VPC fixture region capability selection to include additional capabilities needed by the new NodeBalancer/VPC scenarios.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 7 comments.

File Description
test/integration/models/nodebalancer/test_nodebalancer.py Adds new integration tests covering frontend VPC IP assignment and premium 40Gbps type behavior.
test/integration/conftest.py Expands region capability requirements for VPC fixture and introduces IPv4-only VPC/subnet fixtures used by the new tests.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Contributor

@ezilber-akamai ezilber-akamai left a comment

Choose a reason for hiding this comment

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

Tests pass locally other than the occasional

[400] The selected region does not have any availability for the requested NodeBalancer.

error. Once that is resolved I will approve.

@mawilk90 mawilk90 changed the title Integration tests for NB Front-End IP & 40Gbps TPT-4206: Integration tests for NB Front-End IP & 40Gbps Mar 12, 2026
@mawilk90
Copy link
Contributor Author

mawilk90 commented Mar 12, 2026

Hi @psnoch-akamai , @ezilber-akamai
The reason of instability of some tests is that premium/premium_40gb nodebalancers cannot be created in all the regions. AFAIK from the nodebalancer's team, there is no option to get only the valid regions for premium nodebalancers at the moment (capabilities are not enough) so I decided to hardcode valid region names in the test file + add dedicated fixture and filtering in "get_region" method. If you find that solution overcomplicated, pls let me know.

@ezilber-akamai ezilber-akamai self-requested a review March 12, 2026 19:00
@ezilber-akamai
Copy link
Contributor

ezilber-akamai commented Mar 12, 2026

Hi @psnoch-akamai , @ezilber-akamai The reason of instability of some tests is that premium/premium_40gb nodebalancers cannot be created in all the regions. AFAIK from the nodebalancer's team, there is no option to get only the valid regions for premium nodebalancers at the moment (capabilities are not enough) so I decided to hardcode valid region names in the test file + add dedicated fixture and filtering in "get_region" method. If you find that solution overcomplicated, pls let me know.

I think this is quite elegant given the circumstances 👍

Edit: I got [400] The selected region does not have any availability for the requested NodeBalancer. the first time I ran the tests after pulling down the latest commit

Edit 2: Ran the test a bunch more times, it fails infrequently but I did get it to fail more than once. We could consider hard coding one working region for now and adding a TODO to fix that once this is more generally available.

@dawiddzhafarov
Copy link
Contributor

dawiddzhafarov commented Mar 13, 2026

I'm also getting such errors quite consistently:

test/integration/conftest.py:126: in get_region
    return random.choice(regions)
           ^^^^^^^^^^^^^^^^^^^^^^
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <random.Random object at 0x13a878e20>, seq = []

    def choice(self, seq):
        """Choose a random element from a non-empty sequence."""
    
        # As an accommodation for NumPy, we don't use "if not seq"
        # because bool(numpy.array()) raises a ValueError.
        if not len(seq):
>           raise IndexError('Cannot choose from an empty sequence')
E           IndexError: Cannot choose from an empty sequence

@dawiddzhafarov dawiddzhafarov self-requested a review March 13, 2026 13:03
Copy link
Contributor

@dawiddzhafarov dawiddzhafarov left a comment

Choose a reason for hiding this comment

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

Once the correct tags are used, tests are passing!

Copy link
Contributor

@psnoch-akamai psnoch-akamai left a comment

Choose a reason for hiding this comment

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

All my notes discussed during Webex call. Good job!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants