e2e: add controller recovery test - #152
Open
ptalgulk01 wants to merge 1 commit into
Open
ptalgulk01 wants to merge 1 commit into
ptalgulk01 wants to merge 1 commit into
Conversation
Collaborator
Author
HarshwardhanPatil07
requested changes
Sep 2, 2026
Comment on lines
+640
to
+665
| // Phase 3: Patch pool to update image while controller is down. | ||
| updateRef := env.NodeImageUpdateDigestedPullSpec() | ||
|
|
||
| poolModified := pool.DeepCopy() | ||
| poolModified.Spec.Image.Ref = updateRef | ||
| g.Expect(env.Client.Patch(ctx, poolModified, client.MergeFrom(pool))).To(Succeed()) | ||
| *pool = *poolModified | ||
|
|
||
| t.Logf("Patched pool to update image %s while controller is down", updateRef) | ||
|
|
||
| // Wait briefly to confirm nothing happens while controller is down. | ||
| g.Consistently(func() (bootcv1alpha1.BootcNodeStatus, error) { | ||
| var bn bootcv1alpha1.BootcNode | ||
| err := env.Client.Get(ctx, client.ObjectKey{Name: nodeName}, &bn) | ||
| return bn.Status, err | ||
| }).WithTimeout(10*time.Second).WithPolling(2*time.Second).Should( | ||
| HaveField("Booted.ImageDigest", Equal(env.NodeImageDigest())), | ||
| "node should not update while controller is down", | ||
| ) | ||
|
|
||
| // Phase 4: Scale controller back to one. | ||
| g.Expect(env.Client.Get(ctx, deployKey, controllerDeploy)).To(Succeed()) | ||
| modified = controllerDeploy.DeepCopy() | ||
| one := int32(1) | ||
| modified.Spec.Replicas = &one | ||
| g.Expect(env.Client.Patch(ctx, modified, client.MergeFrom(controllerDeploy))).To(Succeed()) |
Member
There was a problem hiding this comment.
Test never interrupts an active rollout
The image changes while the controller is already stopped, so restart simply begins a new rollout.
HarshwardhanPatil07
left a comment
Member
There was a problem hiding this comment.
You will need to sign DCO
ptalgulk01
force-pushed
the
e2e-controller-recovery
branch
2 times, most recently
from
September 7, 2026 11:35
f5b290b to
307a246
Compare
alicefr
reviewed
Sep 11, 2026
|
|
||
| t.Logf("Rollout in progress; interrupting the controller") | ||
|
|
||
| // Phase 4: Scale the controller to zero, interrupting the active rollout. |
Collaborator
There was a problem hiding this comment.
I'm wondering if we should pause the pool at this stage. I'm afraid that if the pulling is fast enough, the node might go in rebooting before scale down the controller, and it is a possible source for race conditions. Would it make sense to pause it when we detect the staging, scale down the operator and unpause it?
Collaborator
Author
There was a problem hiding this comment.
yes it does, I have updated, thankyou for pointing out.
alicefr
reviewed
Sep 11, 2026
alicefr
reviewed
Sep 11, 2026
ptalgulk01
force-pushed
the
e2e-controller-recovery
branch
from
September 17, 2026 09:29
307a246 to
41a2d2f
Compare
Signed-off-by: Prachiti Talgulkar <ptalgulk01@users.noreply.github.com>
ptalgulk01
force-pushed
the
e2e-controller-recovery
branch
from
September 17, 2026 10:51
bf97f09 to
bdef940
Compare
alicefr
approved these changes
Sep 17, 2026
alicefr
enabled auto-merge (rebase)
September 17, 2026 11:34
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Context
Part of the e2e test planning in #69 (scenario 5: kill controller/daemon during rollout).
Manual testing also revealed that scenarios 4 (faulty node after reboot) and 8 (cross-distro bad image) both fail — the controller has no reboot timeout and doesn't correlate Node.Ready status, so nodes stuck after reboot are never marked degraded. Those need feature work before tests can be written.
Test plan