Skip to content

[release-4.19] OCPBUGS-112275: Fix flaky TestAsyncCache backend test - #17048

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

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

Conversation

@platex-rehor-bot

Copy link
Copy Markdown
Contributor

Summary

Backport of OCPBUGS-86511 fix to release-4.19.

Cherry-pick of b690361 from main with merge conflict resolved in pkg/serverutils/asynccache/asyncccache_test.go. The old loop-based timing assertions (for loop + time.Sleep + matches counter) were replaced with require.Eventually to eliminate flaky behavior.

Bug: https://redhat.atlassian.net/browse/OCPBUGS-112275
Original PR: #17009

Changes

  • Replace timing-dependent for-loop assertions with require.Eventually in TestAsyncCache
  • Wait for first refresh after Run() before capturing baseline
  • Assert item stability within refresh interval, then assert item replacement after interval

Test plan

  • go test ./pkg/serverutils/asynccache/ -v -run TestAsyncCache -count=5 — 5/5 pass

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-112275, which is invalid:

  • expected dependent Jira Issue OCPBUGS-112274 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
  • expected dependent Jira Issue OCPBUGS-112274 to target a version in 4.20.0, 4.20.z, but no target version was set

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:

Summary

Backport of OCPBUGS-86511 fix to release-4.19.

Cherry-pick of b690361 from main with merge conflict resolved in pkg/serverutils/asynccache/asyncccache_test.go. The old loop-based timing assertions (for loop + time.Sleep + matches counter) were replaced with require.Eventually to eliminate flaky behavior.

Bug: https://redhat.atlassian.net/browse/OCPBUGS-112275
Original PR: #17009

Changes

  • Replace timing-dependent for-loop assertions with require.Eventually in TestAsyncCache
  • Wait for first refresh after Run() before capturing baseline
  • Assert item stability within refresh interval, then assert item replacement after interval

Test plan

  • go test ./pkg/serverutils/asynccache/ -v -run TestAsyncCache -count=5 — 5/5 pass

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: 465ec62f-388c-4435-9ac8-bd0a3b71555d

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.

@openshift-ci
openshift-ci Bot requested review from TheRealJon and jhadvig August 19, 2026 20:16
@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
@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-112275, which is invalid:

  • expected dependent Jira Issue OCPBUGS-112274 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-112275, which is invalid:

  • expected dependent Jira Issue OCPBUGS-112274 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-112275, which is invalid:

  • expected dependent Jira Issue OCPBUGS-112274 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.

@jhadvig

jhadvig commented Aug 22, 2026

Copy link
Copy Markdown
Member

/lgtm
/approve
/label backport-risk-assessed
/verified by CI

@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
@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:

/lgtm
/approve
/label backport-risk-assessed
/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-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-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-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
@openshift-ci

openshift-ci Bot commented Aug 22, 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 3ff5f62 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/invalid-bug Indicates that a referenced Jira bug is invalid 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