Skip to content

OCPBUGS-85426: improve DCM tests to reduce flakiness in endpoints#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 in endpoints#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 a race when patching endpoints resource. This update adds 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, which helps to correlate the current state and what should be expected in the test scenario.

Example of deployments state log:

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.

@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

Walkthrough

This PR improves router e2e test reliability and diagnostics. It adds Route client initialization and extended failure output, introduces deployment state logging helpers that capture pod details, stabilizes detached service creation via Endpoints polling, and provides new tabular output functions for visualizing Endpoints and EndpointSlices.

Changes

Router Test Diagnostics and Stability

Layer / File(s) Summary
Endpoint and Route Logging Output Helpers
test/extended/router/stress.go
Adds strconv and discoveryv1 imports; introduces outputEndpoints() and outputEndpointSlice() functions that render Kubernetes Endpoints and EndpointSlices as formatted tables with address readiness and port details, logging output via e2e.Logf.
Failure Diagnostics with Route Details
test/extended/router/config_manager_ingress.go
Initializes a routeClient; extends AfterEach failure handler to list Routes and emit Route details when specs fail; clarifies router and service namespace wording in an inline comment.
Deployment State Logging Helpers
test/extended/router/config_manager_ingress.go
Adds printDeploymentState(ctx) helper to best-effort log exposed deployment pod names, phases, and IPs; adds fetchPods(ctx) to retrieve pods; refactors fetchServiceReplicas(ctx) to reuse fetchPods and derive backend server names from returned pods.
Deployment State Logging Integration
test/extended/router/config_manager_ingress.go
Integrates printDeploymentState calls into createDeploymentStack (after exposing and before returning), scaleDeployment (before returning), and the churn/balance test loop (after deployment ready).
Service Stability and Minor Fixes
test/extended/router/config_manager_ingress.go
Stabilizes detached service creation by polling Endpoints retrieval in a retry loop (instead of single Get), logging transient fetch errors; corrects "subnets" → "subsets" typo in scaleInEndpoints comment.

🎯 3 (Moderate) | ⏱️ ~25 minutes


Caution

Pre-merge checks failed

Please resolve all errors before merging. Addressing warnings is optional.

  • Ignore

❌ Failed checks (1 error, 2 warnings)

Check name Status Explanation Resolution
Stable And Deterministic Test Names ❌ Error Found dynamic content in test step names. Three g.By() calls use fmt.Sprintf with loop variables containing numeric values (replicas count and iteration numbers). Replace fmt.Sprintf in g.By() calls with static descriptive names without embedded loop variables or iteration counts.
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.
Single Node Openshift (Sno) Test Compatibility ⚠️ Warning New Ginkgo tests lack SNO compatibility protection. config_manager_ingress.go adds 8 tests, stress.go adds 3 tests. Tests create multi-replica deployments/routers without SNO safeguards. Add [Skipped:SingleReplicaTopology] labels to test names OR add exutil.IsSingleNode() checks. Apply to all 11 It blocks across both files.
✅ Passed checks (9 passed)
Check name Status Explanation
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.
Test Structure And Quality ✅ Passed All quality requirements met: single responsibility, proper setup/cleanup, timeouts on cluster operations, and consistent patterns.
Microshift Test Compatibility ✅ Passed No new Ginkgo tests are added. Changes only modify existing test helpers and add diagnostic logging functions. Existing tests use [apigroup:route.openshift.io] tag for MicroShift compatibility.
Topology-Aware Scheduling Compatibility ✅ Passed Test infrastructure files only. No scheduling constraints or topology-dependent code that would break SNO, TNF, TNA, or HyperShift topologies.
Ote Binary Stdout Contract ✅ Passed All logging uses framework.Logf or e2e.Logf from within test blocks (It, AfterEach). No process-level stdout writes detected. Helper functions write to buffers with fmt.Fprintf, not stdout.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed No new Ginkgo e2e tests are added in this PR. Changes only modify helper functions for existing tests. The custom check applies only when new tests are added.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title directly relates to the primary objective: improving DCM (Data Center Management) tests to reduce flakiness in endpoint handling through enhanced diagnostics and polling.
✨ 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.

Addressing a race when patching endpoints resource. This update adds 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, which helps to correlate the current state and what should be
expected in the test scenario.

Example of deployments state log:

```
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
@jcmoraisjr jcmoraisjr force-pushed the OCPBUGS-85426-dcm-test-flakiness branch from 3dcf0fe to f272628 Compare May 18, 2026 13:22
@jcmoraisjr jcmoraisjr changed the title OCPBUGS-85426: improve DCM tests to reduce flakiness OCPBUGS-85426: improve DCM tests to reduce flakiness in endpoints May 18, 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

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