[release-4.20] OCPBUGS-112274: Fix flaky TestAsyncCache backend test - #17047
[release-4.20] OCPBUGS-112274: Fix flaky TestAsyncCache backend test#17047platex-rehor-bot wants to merge 1 commit into
Conversation
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>
|
Pipeline controller notification For optional jobs, comment This repository is configured in: LGTM mode |
|
@platex-rehor-bot: This pull request references Jira Issue OCPBUGS-112274, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. DetailsIn response to this:
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. |
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository: openshift/coderabbit/.coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
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. Comment |
|
/jira refresh |
|
@platex-rehor-bot: This pull request references Jira Issue OCPBUGS-112274, which is invalid:
Comment DetailsIn response to this:
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. |
|
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 Tip We noticed you've done this a few times! Consider joining the org to skip this step and gain Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. DetailsInstructions 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. |
|
/ok-to-test |
|
/jira refresh |
|
@platex-rehor-bot: This pull request references Jira Issue OCPBUGS-112274, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. DetailsIn response to this:
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. |
|
/jira refresh |
|
@platex-rehor-bot: This pull request references Jira Issue OCPBUGS-112274, which is invalid:
Comment DetailsIn response to this:
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. |
|
/jira refresh |
|
@platex-rehor-bot: This pull request references Jira Issue OCPBUGS-112274, which is invalid:
Comment DetailsIn response to this:
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. |
|
/jira refresh |
|
@jhadvig: This pull request references Jira Issue OCPBUGS-112274, which is valid. 7 validation(s) were run on this bug
DetailsIn response to this:
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
left a comment
There was a problem hiding this comment.
/label backport-risk-assessed
|
/lgtm |
|
/verified by CI |
|
@jhadvig: This PR has been marked as verified by DetailsIn response to this:
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. |
|
[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 DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
Scheduling tests matching the |
|
@platex-rehor-bot: The following test failed, say
Full PR test history. Your PR dashboard. DetailsInstructions 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. |
CONSOLE Features and Fixes:
Backport of OCPBUGS-86511 fix to release-4.20.
Solution description
The
TestAsyncCacheGo test is flaky on CI due to timing-dependent assertions. This backport applies the same fix from main/release-5.0:NewAsyncCache:initializationRetryIntervalandinitializationTimeoutwere set after the constructor, so they had no effect on the error-case test. Now set before witht.Cleanupto restore originals.time.Sleep+ manual checks withrequire.Eventually: Fixed sleep durations fail on loaded CI machines.require.Eventuallypolls until the condition is met or a generous timeout expires.Run():wait.UntilWithContextfiresrunCacheimmediately, 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.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