Skip to content

[release-4.20] OCPBUGS-112274: Fix flaky TestAsyncCache backend test - #17047

Open
platex-rehor-bot wants to merge 1 commit into
openshift:release-4.20from
platex-rehor-bot:bot/OCPBUGS-112274
Open

[release-4.20] OCPBUGS-112274: Fix flaky TestAsyncCache backend test#17047
platex-rehor-bot wants to merge 1 commit into
openshift:release-4.20from
platex-rehor-bot:bot/OCPBUGS-112274

Conversation

@platex-rehor-bot

Copy link
Copy Markdown
Contributor

CONSOLE Features and Fixes:

Backport of OCPBUGS-86511 fix to release-4.20.

Solution description

The TestAsyncCache Go test is flaky on CI due to timing-dependent assertions. This backport applies the same fix from main/release-5.0:

  1. Move initialization overrides before NewAsyncCache: initializationRetryInterval and initializationTimeout were set after the constructor, so they had no effect on the error-case test. Now set before with t.Cleanup to restore originals.
  2. Replace time.Sleep + manual checks with require.Eventually: Fixed sleep durations fail on loaded CI machines. require.Eventually polls until the condition is met or a generous timeout expires.
  3. Re-grab reference after Run(): wait.UntilWithContext fires runCache immediately, replacing the cached pointer. The test now waits for this first refresh before capturing the baseline, avoiding a race.

Test cases:

  • go test ./pkg/serverutils/asynccache/ -v -run TestAsyncCache — passes consistently.
  • The fix eliminates the timing-dependent flakiness by using polling-based assertions instead of fixed sleeps.

Additional info:

Cherry-pick from release-5.0 had merge conflicts due to different test structure on release-4.20 (loop-based vs linear assertions). Resolved by applying the same fix pattern to the 4.20 test code.

🤖 Generated with Claude Code

Backport of OCPBUGS-86511 fix to release-4.20. Move
initializationRetryInterval and initializationTimeout overrides before
NewAsyncCache so they take effect for the error case test. Replace
fixed time.Sleep assertions with require.Eventually to tolerate slow
CI environments. Re-grab the reference item after Run() fires its
immediate reload to avoid races with the first refresh.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@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: LGTM mode

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

Copy link
Copy Markdown
Contributor

@platex-rehor-bot: This pull request references Jira Issue OCPBUGS-112274, which is invalid:

  • expected the bug to target the "4.20.z" version, but no target version was set
  • release note text must be set and not match the template OR release note type must be set to "Release Note Not Required". For more information you can reference the OpenShift Bug Process.
  • expected dependent Jira Issue OCPBUGS-112273 to be in one of the following states: VERIFIED, RELEASE PENDING, CLOSED (ERRATA), CLOSED (CURRENT RELEASE), CLOSED (DONE), CLOSED (DONE-ERRATA), but it is POST instead

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

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

Details

In response to this:

CONSOLE Features and Fixes:

Backport of OCPBUGS-86511 fix to release-4.20.

Solution description

The TestAsyncCache Go test is flaky on CI due to timing-dependent assertions. This backport applies the same fix from main/release-5.0:

  1. Move initialization overrides before NewAsyncCache: initializationRetryInterval and initializationTimeout were set after the constructor, so they had no effect on the error-case test. Now set before with t.Cleanup to restore originals.
  2. Replace time.Sleep + manual checks with require.Eventually: Fixed sleep durations fail on loaded CI machines. require.Eventually polls until the condition is met or a generous timeout expires.
  3. Re-grab reference after Run(): wait.UntilWithContext fires runCache immediately, replacing the cached pointer. The test now waits for this first refresh before capturing the baseline, avoiding a race.

Test cases:

  • go test ./pkg/serverutils/asynccache/ -v -run TestAsyncCache — passes consistently.
  • The fix eliminates the timing-dependent flakiness by using polling-based assertions instead of fixed sleeps.

Additional info:

Cherry-pick from release-5.0 had merge conflicts due to different test structure on release-4.20 (loop-based vs linear assertions). Resolved by applying the same fix pattern to the 4.20 test code.

🤖 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.

@coderabbitai

coderabbitai Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository: openshift/coderabbit/.coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: e225ecd7-88c5-4455-9dee-a69d4a3fc9f6

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

@platex-rehor-bot

Copy link
Copy Markdown
Contributor Author

/jira refresh

@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@platex-rehor-bot: This pull request references Jira Issue OCPBUGS-112274, which is invalid:

  • expected the bug to target the "4.20.z" version, but no target version was set
  • release note text must be set and not match the template OR release note type must be set to "Release Note Not Required". For more information you can reference the OpenShift Bug Process.
  • expected dependent Jira Issue OCPBUGS-112273 to be in one of the following states: VERIFIED, RELEASE PENDING, CLOSED (ERRATA), CLOSED (CURRENT RELEASE), CLOSED (DONE), CLOSED (DONE-ERRATA), but it is POST instead

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

Details

In response to this:

/jira refresh

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 review from TheRealJon and jhadvig August 19, 2026 20:07
@openshift-ci openshift-ci Bot added component/backend Related to backend needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Aug 19, 2026
@openshift-ci

openshift-ci Bot commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Hi @platex-rehor-bot. Thanks for your PR.

I'm waiting for a openshift member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Tip

We noticed you've done this a few times! Consider joining the org to skip this step and gain /lgtm and other bot rights. We recommend asking approvers on your previous PRs to sponsor you.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

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.

@jhadvig

jhadvig commented Aug 19, 2026

Copy link
Copy Markdown
Member

/ok-to-test

@openshift-ci openshift-ci Bot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Aug 19, 2026
@jhadvig jhadvig changed the title OCPBUGS-112274: Fix flaky TestAsyncCache backend test [release-4.20] OCPBUGS-112274: Fix flaky TestAsyncCache backend test Aug 19, 2026
@platex-rehor-bot

Copy link
Copy Markdown
Contributor Author

/jira refresh

@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@platex-rehor-bot: This pull request references Jira Issue OCPBUGS-112274, which is invalid:

  • release note text must be set and not match the template OR release note type must be set to "Release Note Not Required". For more information you can reference the OpenShift Bug Process.
  • expected dependent Jira Issue OCPBUGS-112273 to be in one of the following states: VERIFIED, RELEASE PENDING, CLOSED (ERRATA), CLOSED (CURRENT RELEASE), CLOSED (DONE), CLOSED (DONE-ERRATA), but it is POST instead

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

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

Details

In response to this:

/jira refresh

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.

@platex-rehor-bot

Copy link
Copy Markdown
Contributor Author

/jira refresh

@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@platex-rehor-bot: This pull request references Jira Issue OCPBUGS-112274, which is invalid:

  • expected dependent Jira Issue OCPBUGS-112273 to be in one of the following states: VERIFIED, RELEASE PENDING, CLOSED (ERRATA), CLOSED (CURRENT RELEASE), CLOSED (DONE), CLOSED (DONE-ERRATA), but it is POST instead

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

Details

In response to this:

/jira refresh

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.

@platex-rehor-bot

Copy link
Copy Markdown
Contributor Author

/jira refresh

@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@platex-rehor-bot: This pull request references Jira Issue OCPBUGS-112274, which is invalid:

  • expected dependent Jira Issue OCPBUGS-112273 to be in one of the following states: VERIFIED, RELEASE PENDING, CLOSED (ERRATA), CLOSED (CURRENT RELEASE), CLOSED (DONE), CLOSED (DONE-ERRATA), but it is MODIFIED instead

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

Details

In response to this:

/jira refresh

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.

@jhadvig jhadvig changed the title [release-4.20] OCPBUGS-112274: Fix flaky TestAsyncCache backend test [release-4.19] OCPBUGS-112274: Fix flaky TestAsyncCache backend test Aug 21, 2026
@jhadvig jhadvig changed the title [release-4.19] OCPBUGS-112274: Fix flaky TestAsyncCache backend test [release-4.20] OCPBUGS-112274: Fix flaky TestAsyncCache backend test Aug 21, 2026
@jhadvig

jhadvig commented Aug 22, 2026

Copy link
Copy Markdown
Member

/jira refresh

@openshift-ci-robot openshift-ci-robot added the jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. label Aug 22, 2026
@openshift-ci-robot

Copy link
Copy Markdown
Contributor

@jhadvig: This pull request references Jira Issue OCPBUGS-112274, which is valid.

7 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.20.z) matches configured target version for branch (4.20.z)
  • bug is in the state POST, which is one of the valid states (NEW, ASSIGNED, POST)
  • release note type set to "Release Note Not Required"
  • dependent bug Jira Issue OCPBUGS-112273 is in the state Verified, which is one of the valid states (VERIFIED, RELEASE PENDING, CLOSED (ERRATA), CLOSED (CURRENT RELEASE), CLOSED (DONE), CLOSED (DONE-ERRATA))
  • dependent Jira Issue OCPBUGS-112273 targets the "4.21" version, which is one of the valid target versions: 4.21.0, 4.21.z
  • bug has dependents
Details

In response to this:

/jira refresh

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 removed the jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. label Aug 22, 2026

@jhadvig jhadvig left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

/label backport-risk-assessed

@openshift-ci openshift-ci Bot added the backport-risk-assessed Indicates a PR to a release branch has been evaluated and considered safe to accept. label Aug 22, 2026
@jhadvig

jhadvig commented Aug 22, 2026

Copy link
Copy Markdown
Member

/lgtm
/approve

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

jhadvig commented Aug 22, 2026

Copy link
Copy Markdown
Member

/verified by CI

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

Copy link
Copy Markdown
Contributor

@jhadvig: 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 added the lgtm Indicates that a PR is ready to be merged. label Aug 22, 2026
@openshift-ci

openshift-ci Bot commented Aug 22, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jhadvig, platex-rehor-bot

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-merge-bot

Copy link
Copy Markdown
Contributor

Scheduling tests matching the pipeline_run_if_changed or not excluded by pipeline_skip_if_only_changed parameters:
/test e2e-gcp-console

@openshift-merge-bot

Copy link
Copy Markdown
Contributor

/retest-required

Remaining retests: 0 against base HEAD 43d45bc and 2 for PR HEAD af158e5 in total

@openshift-ci

openshift-ci Bot commented Aug 23, 2026

Copy link
Copy Markdown
Contributor

@platex-rehor-bot: 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-gcp-console af158e5 link true /test e2e-gcp-console

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. backport-risk-assessed Indicates a PR to a release branch has been evaluated and considered safe to accept. component/backend Related to backend 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. lgtm Indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. 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