OCPBUGS-84867: Fix OCL test to handle temporarily empty current-machine-os-build annotation#5913
Conversation
…otation
The waitForMOSCToUpdateCurrentMOSB helper was failing when the
current-machine-os-build annotation was temporarily cleared.
Background:
When the stale annotation fix (OCPBUGS-84150) detects that the
annotation points to a build for an old rendered config, it clears
the annotation. This creates a brief window where the annotation is
empty (between clearing stale and new build creation).
The test helper was checking: currentMOSB != mosbName
When annotation is empty (""), this returns true, causing the helper
to return "" (empty string) immediately. The test then tries to get
a MOSB with name "" which fails with "resource name may not be empty".
Fix:
Wait for annotation to be non-empty AND different from the old MOSB:
return currentMOSB != "" && currentMOSB != mosbName
This allows the test to wait through the temporary empty state until
the new MOSB is created and annotation is set.
Affected test: TestMissingImageIsRebuilt (and potentially others)
|
Pipeline controller notification For optional jobs, comment This repository is configured in: LGTM mode |
WalkthroughThis change modifies the polling logic in a test's wait function to add an additional check ensuring the Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes 🚥 Pre-merge checks | ✅ 10 | ❌ 2❌ Failed checks (1 warning, 1 inconclusive)
✅ Passed checks (10 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
|
@dkhater-redhat: This pull request references Jira Issue OCPBUGS-84867, 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. |
|
@dkhater-redhat: This pull request references Jira Issue OCPBUGS-84867, which is valid. The bug has been moved to the POST state. 3 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. |
|
@dkhater-redhat: This pull request references Jira Issue OCPBUGS-84867, which is valid. 3 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. |
|
/test unit |
|
Scheduling tests matching the |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dkhater-redhat, isabella-janssen 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 |
The waitForMOSCToUpdateCurrentMOSB helper was failing when the current-machine-os-build annotation was temporarily cleared.
Background:
When the stale annotation fix (OCPBUGS-84150) detects that the annotation points to a build for an old rendered config, it clears the annotation. This creates a brief window where the annotation is empty (between clearing stale and new build creation).
The test helper was checking: currentMOSB != mosbName When annotation is empty (""), this returns true, causing the helper to return "" (empty string) immediately. The test then tries to get a MOSB with name "" which fails with "resource name may not be empty".
Fix:
Wait for annotation to be non-empty AND different from the old MOSB:
return currentMOSB != "" && currentMOSB != mosbName
This allows the test to wait through the temporary empty state until the new MOSB is created and annotation is set.
Affected test: TestMissingImageIsRebuilt
- What I did
- How to verify it
- Description for the changelog
Summary by CodeRabbit