Skip to content

test: DNSPolicy load-balancing strategy conflict#819

Merged
averevki merged 1 commit intoKuadrant:mainfrom
averevki:test-strategy-conflict
Nov 28, 2025
Merged

test: DNSPolicy load-balancing strategy conflict#819
averevki merged 1 commit intoKuadrant:mainfrom
averevki:test-strategy-conflict

Conversation

@averevki
Copy link
Copy Markdown
Contributor

@averevki averevki commented Nov 26, 2025

Description

  • Adds test coverage for DNSPolicy load-balancing strategy conflicts in multicluster environments
  • Validates that when two DNSPolicies target the same hostname with different load-balancing strategies, the second policy is rejected with proper error messaging
  • Refactors dns_server and dns_server2 fixtures to be available at the multicluster package level for better reusability

Closes #789

Changes

New Features

  • New test file: testsuite/tests/multicluster/test_strategy_conflict.py
    • Implements test_lb_strategy_conflict() to verify DNSPolicy strategy conflict detection
    • Tests that conflicting DNSPolicy shows Enforced=False condition
    • Validates DNS record condition shows ProviderError with CNAME/A record type conflict message
    • Verifies DNS resolution returns only the first gateway's IP address

Refactoring

  • Moved dns_server fixture from testsuite/tests/multicluster/load_balanced/conftest.py to testsuite/tests/multicluster/conftest.py for package-level availability
  • Simplified dns_server2 fixture in testsuite/tests/multicluster/load_balanced/conftest.py to validate and return only the second DNS server configuration
  • Removed dns_config fixture from load_balanced tests (no longer needed with individual server fixtures)

Verification steps

Run the new test:

poetry run pytest -vv testsuite/tests/multicluster/test_strategy_conflict.py

# Verify existing load-balanced tests still pass:
poetry run pytest -vv testsuite/tests/multicluster/load_balanced/

@averevki averevki self-assigned this Nov 26, 2025
@github-project-automation github-project-automation Bot moved this to 🆕 New in Kuadrant QE Nov 26, 2025
@averevki averevki moved this to Ready For Review in Kuadrant Nov 26, 2025
Comment thread testsuite/tests/multicluster/test_strategy_conflict.py Outdated
Signed-off-by: averevki <sandyverevkin@gmail.com>
@averevki averevki force-pushed the test-strategy-conflict branch from 376a8c5 to 338ed3f Compare November 26, 2025 11:29
Copy link
Copy Markdown
Contributor

@crstrn13 crstrn13 left a comment

Choose a reason for hiding this comment

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

LGTM! :shipit: 🎉

@emmaaroche
Copy link
Copy Markdown
Contributor

emmaaroche commented Nov 26, 2025

New test is passing, however I ran poetry run pytest -vv testsuite/tests/multicluster/load_balanced/ a few times on kua-420 pairs and kua-hub pairs and got same result:

FAILED testsuite/tests/multicluster/load_balanced/test_load_balanced_geo.py::test_load_balanced_geo - httpx.ConnectTimeout: timed out

But this is likely environmental issue, is this happening for you @crstrn13 @averevki

Copy link
Copy Markdown
Member

@azgabur azgabur left a comment

Choose a reason for hiding this comment

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

Non-blocking, otherwise LGTM

Comment thread testsuite/tests/multicluster/test_strategy_conflict.py
@averevki
Copy link
Copy Markdown
Contributor Author

@emmaaroche It is indeed an unrelated environmental issue we have, you can also check that it was failing on nightly runs for the last week. Looking into this but test is passing on hub cluster for me today

@averevki averevki merged commit 3fec153 into Kuadrant:main Nov 28, 2025
3 checks passed
@github-project-automation github-project-automation Bot moved this from 🆕 New to ✅ Done in Kuadrant QE Nov 28, 2025
@github-project-automation github-project-automation Bot moved this from Ready For Review to Done in Kuadrant Nov 28, 2025
@averevki averevki deleted the test-strategy-conflict branch November 28, 2025 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done
Status: ✅ Done

Development

Successfully merging this pull request may close these issues.

Add test for DNSPolicy strategy conflict

4 participants