Skip to content

Update change_targetref tests to fix azure DNS issue#697

Merged
emmaaroche merged 1 commit intoKuadrant:mainfrom
emmaaroche:update-targetref-tests-dns-issue
Jul 1, 2025
Merged

Update change_targetref tests to fix azure DNS issue#697
emmaaroche merged 1 commit intoKuadrant:mainfrom
emmaaroche:update-targetref-tests-dns-issue

Conversation

@emmaaroche
Copy link
Copy Markdown
Contributor

@emmaaroche emmaaroche commented Jun 27, 2025

Description

Issue described in #696. This fix aims to help avoid inconsistent test failures when DNS records take time to propagate, especially on Azure.

What was the issue

Some change_targetref tests run before DNS is fully ready. Even though the DNSPolicy was created successfully, its status showed:

type: Enforced
status: 'False'
message: 'DNSPolicy has encountered some issues: policy is not enforced on any DNSRecord: not a single DNSRecord is ready'

With recordConditions stuck in:

reason: AwaitingValidation
status: 'False'
type: Ready

This caused test traffic to hit unresolved hostnames and fail with DNS-related errors (nodename nor servname provided).

Changes

  • Refactored DNS readiness logic into the dns_policy2 fixture:

    • Waits for recordConditions to report "Ready" with status=True

    • Waits until the associated hostname successfully resolves (via is_nxdomain)

  • This ensures tests don’t proceed until DNS is actually ready

Note: The helper is not used in the DNSPolicy test, that test is expected to hit a DNS failure.

Related issue

Closes #696.

@emmaaroche emmaaroche self-assigned this Jun 27, 2025
@emmaaroche emmaaroche added the refactor Refactor with same functionality label Jun 27, 2025
@emmaaroche emmaaroche requested a review from averevki June 27, 2025 14:34
Comment thread testsuite/tests/singlecluster/gateway/reconciliation/change_targetref/conftest.py Outdated
Comment thread testsuite/tests/singlecluster/gateway/reconciliation/change_targetref/conftest.py Outdated
Comment thread testsuite/tests/singlecluster/gateway/reconciliation/change_targetref/conftest.py Outdated
@emmaaroche emmaaroche force-pushed the update-targetref-tests-dns-issue branch from eabf5ac to d59de09 Compare June 30, 2025 11:08
@emmaaroche emmaaroche requested a review from averevki June 30, 2025 11:08
Comment thread testsuite/tests/singlecluster/gateway/reconciliation/change_targetref/conftest.py Outdated
Signed-off-by: emmaaroche <eroche@redhat.com>
@emmaaroche emmaaroche force-pushed the update-targetref-tests-dns-issue branch from d59de09 to 726beb1 Compare July 1, 2025 15:22
@emmaaroche emmaaroche merged commit 3d117eb into Kuadrant:main Jul 1, 2025
3 checks passed
@emmaaroche emmaaroche deleted the update-targetref-tests-dns-issue branch July 1, 2025 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

refactor Refactor with same functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hostname not resolving in time on Azure in most change_targetref tests

3 participants