Skip to content

OCPBUGS-85426: improve DCM tests to reduce flakiness#31173

Open
jcmoraisjr wants to merge 1 commit into
openshift:mainfrom
jcmoraisjr:OCPBUGS-85426-dcm-test-flakiness
Open

OCPBUGS-85426: improve DCM tests to reduce flakiness#31173
jcmoraisjr wants to merge 1 commit into
openshift:mainfrom
jcmoraisjr:OCPBUGS-85426-dcm-test-flakiness

Conversation

@jcmoraisjr
Copy link
Copy Markdown
Member

@jcmoraisjr jcmoraisjr commented May 13, 2026

Addressing some flakes in the DCM e2e tests:

  • Race patching endpoints resource: add a polling to ensure the endpoints resource was created. Also, dump all endpoints and endpointSlice in the test namespace in case of a test failure.
  • Timeout calling the router: increase the timeout, reading all the fast ones from a single const. Also, dumping router logs which should help to correlate failures when calling its service.
  • Router container not found: router pod should be reporting container as running and healthy, but it was not running. Attaching the router log, which should help to explain why router container was not found.

Example of testing deployment state log, added whenever it is scaled:

deployment state: replicas=4 pods=route-scale-in-5b7b4f6b8c-9ncjg/Running/10.128.1.27 // route-scale-in-5b7b4f6b8c-ck45n/Running/10.128.1.28 // route-scale-in-5b7b4f6b8c-srffr/Running/10.128.1.29 // route-scale-in-5b7b4f6b8c-v9hm2/Running/10.128.1.26

Example of Endpoints and EndpointSlice resources listed if the test fails:

Endpoints:
NAME                  ADDRESSES                                        NOT READY ADDRESSES  PORTS
route-scale-in        10.128.1.26,10.128.1.27,10.128.1.28,10.128.1.29                       9376
route-scale-in-khbh5  10.128.1.26                                                           9376

EndpointSlices:
NAME                        SERVICE               ADDRESSES                                        NOT READY ADDRESSES  PORTS
route-scale-in-khbh5-8ncmh  route-scale-in-khbh5  10.128.1.26                                                           9376
route-scale-in-rrhzv        route-scale-in        10.128.1.27,10.128.1.28,10.128.1.29,10.128.1.26                       9376

https://redhat.atlassian.net/browse/OCPBUGS-85426

Summary by CodeRabbit

  • Tests
    • Enhanced router test observability with improved logging and debug output for network endpoints and configuration details.
    • Stabilized timing-sensitive test operations through configurable timeout handling.
    • Expanded test failure diagnostics to capture detailed state information for troubleshooting.

Addressing some flakes in the DCM e2e tests:

Race patching endpoints resource: add a polling to ensure the endpoints
resource was created. Also, dump all endpoints and endpointSlice in the
test namespace in case of a test failure.

Timeout calling the router: increase the timeout, reading all the fast
ones from a single const. Also, dumping router logs which should help to
correlate failures when calling its service.

Router container not found: router pod should be reporting container as
running and healthy, but it was not running. Attaching the router log,
which should help to explain why router container was not found.

Example of testing deployment state log, added whenever it is scaled:

```
deployment state: replicas=4 pods=route-scale-in-5b7b4f6b8c-9ncjg/Running/10.128.1.27 // route-scale-in-5b7b4f6b8c-ck45n/Running/10.128.1.28 // route-scale-in-5b7b4f6b8c-srffr/Running/10.128.1.29 // route-scale-in-5b7b4f6b8c-v9hm2/Running/10.128.1.26
```

Example of Endpoints and EndpointSlice resources listed if the test
fails:

```
Endpoints:
NAME                  ADDRESSES                                        NOT READY ADDRESSES  PORTS
route-scale-in        10.128.1.26,10.128.1.27,10.128.1.28,10.128.1.29                       9376
route-scale-in-khbh5  10.128.1.26                                                           9376

EndpointSlices:
NAME                        SERVICE               ADDRESSES                                        NOT READY ADDRESSES  PORTS
route-scale-in-khbh5-8ncmh  route-scale-in-khbh5  10.128.1.26                                                           9376
route-scale-in-rrhzv        route-scale-in        10.128.1.27,10.128.1.28,10.128.1.29,10.128.1.26                       9376
```

https://redhat.atlassian.net/browse/OCPBUGS-85426
@openshift-merge-bot
Copy link
Copy Markdown
Contributor

Pipeline controller notification
This repo is configured to use the pipeline controller. Second-stage tests will be triggered either automatically or after lgtm label is added, depending on the repository configuration. The pipeline controller will automatically detect which contexts are required and will utilize /test Prow commands to trigger the second stage.

For optional jobs, comment /test ? to see a list of all defined jobs. To trigger manually all jobs from second stage use /pipeline required command.

This repository is configured in: automatic mode

@openshift-ci-robot openshift-ci-robot added jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. labels May 13, 2026
@openshift-ci-robot
Copy link
Copy Markdown

@jcmoraisjr: This pull request references Jira Issue OCPBUGS-85426, which is valid. The bug has been moved to the POST state.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (5.0.0) matches configured target version for branch (5.0.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @melvinjoseph86

The bug has been updated to refer to the pull request using the external bug tracker.

Details

In response to this:

Addressing some flakes in the DCM e2e tests:

  • Race patching endpoints resource: add a polling to ensure the endpoints resource was created. Also, dump all endpoints and endpointSlice in the test namespace in case of a test failure.
  • Timeout calling the router: increase the timeout, reading all the fast ones from a single const. Also, dumping router logs which should help to correlate failures when calling its service.
  • Router container not found: router pod should be reporting container as running and healthy, but it was not running. Attaching the router log, which should help to explain why router container was not found.

Example of testing deployment state log, added whenever it is scaled:

deployment state: replicas=4 pods=route-scale-in-5b7b4f6b8c-9ncjg/Running/10.128.1.27 // route-scale-in-5b7b4f6b8c-ck45n/Running/10.128.1.28 // route-scale-in-5b7b4f6b8c-srffr/Running/10.128.1.29 // route-scale-in-5b7b4f6b8c-v9hm2/Running/10.128.1.26

Example of Endpoints and EndpointSlice resources listed if the test fails:

Endpoints:
NAME                  ADDRESSES                                        NOT READY ADDRESSES  PORTS
route-scale-in        10.128.1.26,10.128.1.27,10.128.1.28,10.128.1.29                       9376
route-scale-in-khbh5  10.128.1.26                                                           9376

EndpointSlices:
NAME                        SERVICE               ADDRESSES                                        NOT READY ADDRESSES  PORTS
route-scale-in-khbh5-8ncmh  route-scale-in-khbh5  10.128.1.26                                                           9376
route-scale-in-rrhzv        route-scale-in        10.128.1.27,10.128.1.28,10.128.1.29,10.128.1.26                       9376

https://redhat.atlassian.net/browse/OCPBUGS-85426

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 requested a review from melvinjoseph86 May 13, 2026 19:52
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 13, 2026

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: e2f7040f-59e7-473b-bcde-0fd3ecc61fb6

📥 Commits

Reviewing files that changed from the base of the PR and between d41fea2 and 3dcf0fe.

📒 Files selected for processing (3)
  • test/extended/router/config_manager.go
  • test/extended/router/config_manager_ingress.go
  • test/extended/router/stress.go

Walkthrough

The PR enhances the router e2e test suite with improved observability and robustness. It introduces a configurable timeout constant, implements polling for endpoint fetching, adds deployment state logging helpers, extends failure diagnostics to include route and endpoint information, and refactors router pod targeting.

Changes

Router Test Suite Observability and Stability Enhancements

Layer / File(s) Summary
Timeout configuration
test/extended/router/config_manager.go, test/extended/router/config_manager_ingress.go
Introduces fastTimeoutSeconds = 10 constant and refactors HTTP probes and EndpointSlice wait timeouts to use this configurable value instead of hardcoded 5 seconds, with probe command updated to use curl --max-time.
Endpoints polling and robustness
test/extended/router/config_manager_ingress.go
Changes createDetachedService Endpoints retrieval from a single immediate Get to a polling loop using wait.PollUntilContextTimeout that retries and logs transient fetch errors until endpoints are available.
Deployment state observability
test/extended/router/config_manager_ingress.go
Adds printDeploymentState(ctx) helper to log pod names, phases, and IPs after deployment exposure and scaling; adds fetchPods(ctx) helper to retrieve pods for the exposed deployment; refactors fetchServiceReplicas to reuse fetchPods instead of duplicating pod-listing logic.
Failure diagnostics extension
test/extended/router/config_manager_ingress.go, test/extended/router/stress.go
Initializes routeClient in test setup and extends AfterEach failure handling to list Routes and output ingress route details; adds outputEndpoints(...) and outputEndpointSlice(...) tabular formatting helpers in stress.go that segregate address readiness and log via e2e.Logf.
Router targeting refactor and cleanup
test/extended/router/config_manager_ingress.go
Refactors router exec target setup to assign routerPod separately before deriving execPod; corrects comment typo ("subnets"→"subsets") in scaleInEndpoints; marks unused port parameter as _ in waitForRouteToRespond.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 10 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 28.57% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
Test Structure And Quality ⚠️ Warning Tests lack meaningful failure messages. ~38 error assertions use bare o.Expect(err).NotTo(o.HaveOccurred()) without context messages, violating requirement #4 on assertion clarity. Add context messages to all critical assertions. Replace bare o.Expect(err).NotTo(o.HaveOccurred()) with o.Expect(err).NotTo(o.HaveOccurred(), "describe failure") for better diagnostics.
✅ Passed checks (10 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title accurately summarizes the main objective of reducing flakiness in DCM tests through improved observability, retries, and timeouts.
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 All Ginkgo test names contain only static, deterministic strings. No dynamic information found in test titles across all modified files.
Microshift Test Compatibility ✅ Passed This PR does not add new Ginkgo tests (It/Describe/Context/When). It only modifies bodies of existing tests and adds helper functions. The custom check applies only to newly added tests.
Single Node Openshift (Sno) Test Compatibility ✅ Passed No new Ginkgo tests added. PR only modifies existing tests and adds helper functions. SNO check applies only when new tests are introduced.
Topology-Aware Scheduling Compatibility ✅ Passed Changes are only to e2e test helper files. No deployment manifests, operator code, or controllers modified. Check not applicable to test-only changes.
Ote Binary Stdout Contract ✅ Passed All new functions write to bytes.Buffer, then output via e2e.Logf(). Function calls are from g.AfterEach() blocks, which are safe test-level code. No module-level stdout writes detected.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed Tests properly handle IPv6. Loopback uses IPv6 detection. URLs use exutil.IPUrl() for IPv6. Hardcoded 10.0.0.1 is test fixture only. No external connectivity required.

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

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

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

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

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 13, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jcmoraisjr

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 May 13, 2026
@openshift-ci openshift-ci Bot requested review from Thealisyed and gcs278 May 13, 2026 19:53
@openshift-ci-robot
Copy link
Copy Markdown

@jcmoraisjr: This pull request references Jira Issue OCPBUGS-85426, which is valid.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (5.0.0) matches configured target version for branch (5.0.0)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @melvinjoseph86

Details

In response to this:

Addressing some flakes in the DCM e2e tests:

  • Race patching endpoints resource: add a polling to ensure the endpoints resource was created. Also, dump all endpoints and endpointSlice in the test namespace in case of a test failure.
  • Timeout calling the router: increase the timeout, reading all the fast ones from a single const. Also, dumping router logs which should help to correlate failures when calling its service.
  • Router container not found: router pod should be reporting container as running and healthy, but it was not running. Attaching the router log, which should help to explain why router container was not found.

Example of testing deployment state log, added whenever it is scaled:

deployment state: replicas=4 pods=route-scale-in-5b7b4f6b8c-9ncjg/Running/10.128.1.27 // route-scale-in-5b7b4f6b8c-ck45n/Running/10.128.1.28 // route-scale-in-5b7b4f6b8c-srffr/Running/10.128.1.29 // route-scale-in-5b7b4f6b8c-v9hm2/Running/10.128.1.26

Example of Endpoints and EndpointSlice resources listed if the test fails:

Endpoints:
NAME                  ADDRESSES                                        NOT READY ADDRESSES  PORTS
route-scale-in        10.128.1.26,10.128.1.27,10.128.1.28,10.128.1.29                       9376
route-scale-in-khbh5  10.128.1.26                                                           9376

EndpointSlices:
NAME                        SERVICE               ADDRESSES                                        NOT READY ADDRESSES  PORTS
route-scale-in-khbh5-8ncmh  route-scale-in-khbh5  10.128.1.26                                                           9376
route-scale-in-rrhzv        route-scale-in        10.128.1.27,10.128.1.28,10.128.1.29,10.128.1.26                       9376

https://redhat.atlassian.net/browse/OCPBUGS-85426

Summary by CodeRabbit

  • Tests
  • Enhanced router test observability with improved logging and debug output for network endpoints and configuration details.
  • Stabilized timing-sensitive test operations through configurable timeout handling.
  • Expanded test failure diagnostics to capture detailed state information for troubleshooting.

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-merge-bot openshift-merge-bot Bot added the ready-for-human-review Indicates a PR has been reviewed by automated tools and is ready for human review label May 13, 2026
@openshift-merge-bot
Copy link
Copy Markdown
Contributor

Scheduling required tests:
/test e2e-aws-csi
/test e2e-aws-ovn-fips
/test e2e-aws-ovn-microshift
/test e2e-aws-ovn-microshift-serial
/test e2e-aws-ovn-serial-1of2
/test e2e-aws-ovn-serial-2of2
/test e2e-gcp-csi
/test e2e-gcp-ovn
/test e2e-gcp-ovn-upgrade
/test e2e-metal-ipi-ovn-ipv6
/test e2e-vsphere-ovn
/test e2e-vsphere-ovn-upi

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci Bot commented May 14, 2026

@jcmoraisjr: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-gcp-csi 3dcf0fe link true /test e2e-gcp-csi
ci/prow/e2e-vsphere-ovn-upi 3dcf0fe link true /test e2e-vsphere-ovn-upi

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.

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-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. ready-for-human-review Indicates a PR has been reviewed by automated tools and is ready for human review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants