Skip to content

OLS-2077 - Enabling cert rotation tests.#2875

Open
sriroopar wants to merge 1 commit intoopenshift:mainfrom
sriroopar:enabling-cert-rotation-test
Open

OLS-2077 - Enabling cert rotation tests.#2875
sriroopar wants to merge 1 commit intoopenshift:mainfrom
sriroopar:enabling-cert-rotation-test

Conversation

@sriroopar
Copy link
Copy Markdown
Contributor

Description

Enabling certificate rotation e2e tests with modifications to adapt with recent changes on pod starts/restarts.

Type of change

  • Refactor
  • New feature
  • Bug fix
  • CVE fix
  • Optimization
  • Documentation Update
  • Configuration Update
  • Bump-up dependent library
  • Bump-up library or tool used for development (does not change the final image)
  • CI configuration change
  • Konflux configuration change

Related Tickets & Documents

  • Related Issue #
  • Closes #

Checklist before requesting a review

  • I have performed a self-review of my code.
  • PR has passed all pre-merge test jobs.
  • If it is a core feature, I have added thorough tests.

Testing

  • Please provide detailed steps to perform tests related to this code change.
  • How were the fix/results from this change verified? Please provide relevant screenshots or results.

After enabling and modifying, this test was run across operator HEAD.

@openshift-ci openshift-ci bot requested review from raptorsun and tisnik April 2, 2026 15:02
@sriroopar sriroopar force-pushed the enabling-cert-rotation-test branch from 5b90c28 to 1b1d48a Compare April 2, 2026 15:20
@sriroopar
Copy link
Copy Markdown
Contributor Author

/retest

@JoaoFula
Copy link
Copy Markdown
Contributor

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Apr 10, 2026
Copy link
Copy Markdown
Contributor

@onmete onmete left a comment

Choose a reason for hiding this comment

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

Two findings from code review — both about failure-mode clarity, not correctness of the happy path.

Comment thread tests/e2e/test_api.py Outdated
), "Timed out waiting for pod rollout after CA certificate rotation"

cluster_utils.wait_for_running_pod()
wait_for_ols(pytest.ols_url, timeout=300, interval=10)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The return value of wait_for_ols() is discarded here. If OLS never becomes ready within 300s, the test continues silently and fails at the query step with a misleading error.

Other callers in the codebase (conftest.py, adapt_ols_config.py, data_collector_control.py) all check the return value.

Suggestion:

Suggested change
wait_for_ols(pytest.ols_url, timeout=300, interval=10)
assert wait_for_ols(pytest.ols_url, timeout=300, interval=10), \
"OLS did not become ready after CA certificate rotation"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Addressed in 8e5000f — return value is now asserted.

Comment thread tests/e2e/test_api.py Outdated
30,
_query_succeeds,
"Retrying query while route stabilizes after CA cert rotation",
), f"OLS returned {response.status_code} after CA certificate rotation"
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

If all 6 attempts of _query_succeeds raise exceptions (e.g. ConnectionError), response stays None. The assertion failure message f"OLS returned {response.status_code}..." then raises AttributeError, masking the real failure.

Suggestion:

status = response.status_code if response is not None else "no response (all attempts raised)"
assert retry_until_timeout_or_success(
    6,
    30,
    _query_succeeds,
    "Retrying query while route stabilizes after CA cert rotation",
), f"OLS returned {status} after CA certificate rotation"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Addressed in 8e5000fresponse is guarded against None in the f-string. Also nice additions: type annotation on response and return type on _query_succeeds.

@sriroopar sriroopar force-pushed the enabling-cert-rotation-test branch from 1b1d48a to 8e5000f Compare April 10, 2026 13:34
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Apr 10, 2026
@onmete
Copy link
Copy Markdown
Contributor

onmete commented Apr 10, 2026

/lgtm
/approve

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Apr 10, 2026
@openshift-ci
Copy link
Copy Markdown

openshift-ci bot commented Apr 10, 2026

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: onmete

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 Apr 10, 2026
@sriroopar sriroopar force-pushed the enabling-cert-rotation-test branch from 8e5000f to dd50c91 Compare April 10, 2026 13:48
@openshift-ci openshift-ci bot removed the lgtm Indicates that a PR is ready to be merged. label Apr 10, 2026
@onmete
Copy link
Copy Markdown
Contributor

onmete commented Apr 10, 2026

/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Apr 10, 2026
@openshift-merge-bot
Copy link
Copy Markdown
Contributor

/retest-required

Remaining retests: 0 against base HEAD 893b643 and 2 for PR HEAD dd50c91 in total

@sriroopar
Copy link
Copy Markdown
Contributor Author

/retest

@openshift-merge-bot
Copy link
Copy Markdown
Contributor

/retest-required

Remaining retests: 0 against base HEAD 9096652 and 1 for PR HEAD dd50c91 in total

@openshift-merge-bot
Copy link
Copy Markdown
Contributor

/retest-required

Remaining retests: 0 against base HEAD 055844b and 0 for PR HEAD dd50c91 in total

@openshift-merge-bot
Copy link
Copy Markdown
Contributor

/hold

Revision dd50c91 was retested 3 times: holding

@openshift-ci openshift-ci bot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 15, 2026
@JoaoFula
Copy link
Copy Markdown
Contributor

/retest

@sriroopar
Copy link
Copy Markdown
Contributor Author

/test e2e-ols-cluster

@openshift-ci
Copy link
Copy Markdown

openshift-ci bot commented Apr 20, 2026

@sriroopar: The following test 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-ols-cluster dd50c91 link true /test e2e-ols-cluster

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. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants