Skip to content

USHIFT-7132: Fix DNS resource config test timing#6787

Merged
openshift-merge-bot[bot] merged 1 commit into
openshift:mainfrom
Neilhamza:fix-dns-resource-test-timing
Jun 3, 2026
Merged

USHIFT-7132: Fix DNS resource config test timing#6787
openshift-merge-bot[bot] merged 1 commit into
openshift:mainfrom
Neilhamza:fix-dns-resource-test-timing

Conversation

@Neilhamza

@Neilhamza Neilhamza commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Fix race condition in DNS resource configuration e2e tests where DaemonSet resource values are checked before asset application completes
  • After Restart MicroShift, the API server readiness (/readyz) returns before startDNSController() finishes applying the updated DaemonSet template
  • Tests were seeing stale/default values instead of the configured custom values

Root Cause

Wait For MicroShift checks API server liveness and readiness, but the DNS DaemonSet update happens asynchronously after the API server is ready. The tests were asserting resource values immediately, before the DaemonSet spec was updated.

Fix

Wrap all DaemonSet resource assertions in Wait Until Keyword Succeeds 10x 5s (up to 50s of retries), matching the existing retry pattern used in dns-custom-config.robot and c2cc/dns.robot.

Affected tests (5 of 8):

  • Default DNS Resources
  • Custom DNS Resources With Requests And Limits
  • Requests Only Without Limits
  • Partial Requests Preserves Defaults
  • Limits Only Preserves Default Requests

Test plan

  • CI e2e tests pass consistently (the 4 previously failing tests should now pass)
  • make verify-rf passes locally

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Tests
    • Enhanced DNS resource configuration test suite with improved validation keywords featuring built-in retry and wait mechanisms. Tests now reliably validate default DNS resource configurations, custom request and limit specifications, and partial configuration scenarios by automatically retrying assertions with configurable intervals between attempts, substantially improving overall test robustness and reliability.

After MicroShift restart, the API server becomes ready before the
DNS DaemonSet is updated with new resource values from config. The
tests were checking immediately after restart, seeing stale values.

Wrap DaemonSet resource assertions in Wait Until Keyword Succeeds
(10 retries, 5s interval) to allow time for asset application,
matching the retry pattern used in dns-custom-config.robot and
c2cc/dns.robot.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@openshift-ci-robot

openshift-ci-robot commented Jun 2, 2026

Copy link
Copy Markdown

@Neilhamza: This pull request references USHIFT-7132 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the bug to target the "5.0.0" version, but no target version was set.

Details

In response to this:

Summary

  • Fix race condition in DNS resource configuration e2e tests where DaemonSet resource values are checked before asset application completes
  • After Restart MicroShift, the API server readiness (/readyz) returns before startDNSController() finishes applying the updated DaemonSet template
  • Tests were seeing stale/default values instead of the configured custom values

Root Cause

Wait For MicroShift checks API server liveness and readiness, but the DNS DaemonSet update happens asynchronously after the API server is ready. The tests were asserting resource values immediately, before the DaemonSet spec was updated.

Fix

Wrap all DaemonSet resource assertions in Wait Until Keyword Succeeds 10x 5s (up to 50s of retries), matching the existing retry pattern used in dns-custom-config.robot and c2cc/dns.robot.

Affected tests (5 of 8):

  • Default DNS Resources
  • Custom DNS Resources With Requests And Limits
  • Requests Only Without Limits
  • Partial Requests Preserves Defaults
  • Limits Only Preserves Default Requests

Test plan

  • CI e2e tests pass consistently (the 4 previously failing tests should now pass)
  • make verify-rf passes locally

🤖 Generated with Claude Code

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jun 2, 2026
@coderabbitai

coderabbitai Bot commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Enterprise

Run ID: 817f90fa-79cd-4546-878f-a1a66655c1f3

📥 Commits

Reviewing files that changed from the base of the PR and between 8161288 and 64c22bb.

📒 Files selected for processing (1)
  • test/suites/configuration1/dns-resource-configuration.robot

Walkthrough

This PR refactors DNS resource validation tests in the Robot suite to use retry-based assertions. New wait-and-assert keywords wrap value retrieval with Wait Until Keyword Succeeds, allowing tests to poll DNS resource configurations until they stabilize. Existing test cases are updated to call these keywords instead of directly asserting values.

Changes

DNS Resource Assertion Refactoring

Layer / File(s) Summary
New wait-and-assert keywords
test/suites/configuration1/dns-resource-configuration.robot
Four keywords introduced: DNS Resource Value Should Be, DNS Resource Value Should Be Empty, DNS Resource Value Should Match, and DNS Resource Value Should Match Empty. Each retries for up to 10 attempts with 5s intervals before asserting the DNS resource value.
Test case refactoring
test/suites/configuration1/dns-resource-configuration.robot
Test cases for default resources, custom requests/limits, and partial configurations updated to use new wait-and-assert keywords for DNS resource validation.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

Possibly related PRs

  • openshift/microshift#6621: Adds DNS container resources configuration; this PR refactors the corresponding Robot validation to use wait-and-assert patterns for reliability.

Suggested reviewers

  • agullon
  • eslutsky
  • pacevedom
🚥 Pre-merge checks | ✅ 15
✅ Passed checks (15 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'USHIFT-7132: Fix DNS resource config test timing' directly and clearly summarizes the main change: adding retry logic to DNS resource configuration tests to fix a timing/race condition issue.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Stable And Deterministic Test Names ✅ Passed PR modifies only Robot Framework tests, not Ginkgo tests. Custom check targets Ginkgo (Go BDD), making it inapplicable here. Test names contain no dynamic values.
Test Structure And Quality ✅ Passed PR modifies Robot Framework test suite, not Ginkgo tests. Custom check is specific to Ginkgo code structure and is not applicable to Robot Framework test files.
Microshift Test Compatibility ✅ Passed No new Ginkgo e2e tests added; PR only modifies Robot Framework tests. Custom check applies only to Ginkgo tests.
Single Node Openshift (Sno) Test Compatibility ✅ Passed PR contains only Robot Framework tests, not Ginkgo e2e tests. The SNO compatibility check applies only to new Ginkgo tests (It(), Describe(), Context(), When()), not Robot Framework tests.
Topology-Aware Scheduling Compatibility ✅ Passed PR modifies only test code (Robot Framework), not deployment manifests, operator code, or controllers. The custom check applies to production scheduling constraints, not test infrastructure.
Ote Binary Stdout Contract ✅ Passed PR modifies only a Robot Framework test file, not Go/binary OTE code. This check applies only to binaries outputting JSON; not applicable here.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed PR modifies Robot Framework tests only (.robot file), not Ginkgo e2e tests. Check applies only when new Ginkgo e2e tests are added.
No-Weak-Crypto ✅ Passed PR modifies only dns-resource-configuration.robot, a Robot Framework test file with no weak crypto usage or custom crypto implementations detected.
Container-Privileges ✅ Passed PR only modifies Robot test file; no container manifests, Dockerfiles, or K8s security context configurations were added or changed.
No-Sensitive-Data-In-Logs ✅ Passed No sensitive data (passwords, tokens, keys, PII, credentials) found in logging statements. Changes only log generic error messages and standard Kubernetes service names.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@openshift-ci openshift-ci Bot requested review from eslutsky and jogeo June 2, 2026 09:00
@pmtk

pmtk commented Jun 2, 2026

Copy link
Copy Markdown
Member

/lgtm

@openshift-ci openshift-ci Bot added the lgtm Indicates that a PR is ready to be merged. label Jun 2, 2026
@openshift-ci

openshift-ci Bot commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Neilhamza, pmtk

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-ci openshift-ci Bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 2, 2026
@pacevedom

Copy link
Copy Markdown
Contributor

/verified by CI

@openshift-ci-robot openshift-ci-robot added the verified Signifies that the PR passed pre-merge verification criteria label Jun 3, 2026
@openshift-ci-robot

Copy link
Copy Markdown

@pacevedom: This PR has been marked as verified by CI.

Details

In response to this:

/verified by CI

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci

openshift-ci Bot commented Jun 3, 2026

Copy link
Copy Markdown
Contributor

@Neilhamza: all tests passed!

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

@openshift-merge-bot openshift-merge-bot Bot merged commit b7434a8 into openshift:main Jun 3, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. verified Signifies that the PR passed pre-merge verification criteria

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants