USHIFT-7342: Replace hardcoded sleep with state check before restart#6996
USHIFT-7342: Replace hardcoded sleep with state check before restart#6996pacevedom wants to merge 1 commit into
Conversation
|
/test ? |
|
Skipping CI for Draft Pull Request. |
Walkthrough
ChangesMicroShift Restart Reliability Update
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 15✅ Passed checks (15 passed)
✨ 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 |
|
/test e2e-aws-tests |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@test/resources/microshift-process.resource`:
- Around line 83-89: The PID snapshot is taken too early in the restart flow, so
the existing MicroShift process and etcd PIDs can become stale before the
restart is triggered. Move the MicroShift Process ID and MicroShift Etcd Process
ID captures in this resource so they happen after `Wait Until Keyword Succeeds`
/ `MicroShift Service Is Not Transitioning` and immediately before `Systemctl
restart microshift.service`, then keep the `Wait Until ... Changes` checks
using those fresh values.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository YAML (base), Central YAML (inherited)
Review profile: CHILL
Plan: Enterprise
Run ID: 9704d8bc-0c13-4dad-86cb-b127ce30b0db
📒 Files selected for processing (1)
test/resources/microshift-process.resource
|
/test e2e-aws-tests |
|
/test all |
|
@pacevedom: This pull request references USHIFT-7342 which is a valid jira issue. 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. |
The Restart MicroShift keyword had an unconditional 10s sleep before every restart to avoid issuing restarts while the service was mid-transition. Replace it with an active check that polls systemd ActiveState for transitional states, passing instantly when the service is already stable and saving ~10s per restart. Also reset the systemd failure counter before restarting so that start-limit-hit from prior rapid failures (e.g. invalid config tests) does not block the restart.
| ... many start requests. | ||
| [Documentation] Restart the MicroShift service, waiting for any in-progress | ||
| ... state transition to settle before issuing the restart. | ||
| Wait Until Keyword Succeeds 10x 5s |
There was a problem hiding this comment.
could 50s be too short? elsewhere in this same file "wait for MicroShift Service" allows up to 500
| ... MicroShift Service Is Not Transitioning | ||
| # Clear start-limit-hit so systemctl restart is not rejected after | ||
| # rapid failures (e.g. invalid config that was since removed). | ||
| Execute Command systemctl reset-failed microshift.service sudo=True |
There was a problem hiding this comment.
now that reset-failed is introduced i wonder if transition check (wait) is redundant now
There was a problem hiding this comment.
we could also have a reutrn code check
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Neilhamza, pacevedom 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 |
|
/retest |
|
@pacevedom: all tests passed! 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. |
The Restart MicroShift keyword had an unconditional 10s sleep before every restart to avoid issuing restarts while the service was mid-transition. Replace it with an active check that polls systemd SubState for transitional states, passing instantly when the service is already stable and saving ~10s per restart.
Summary by CodeRabbit