Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,11 @@ var _ = Describe("[rfe_id:27363][performance] CPU Management", Ordered, func() {
cpuManagerCpusetBeforeRestart, err := nodes.CpuManagerCpuSet(ctx, workerRTNode)
Expect(err).ToNot(HaveOccurred())
testlog.Infof("pre kubelet restart default cpuset: %v", cpuManagerCpusetBeforeRestart.String())

By("capturing test pod state before restart")
originalPodUID := testpod.UID
testlog.Infof("pre kubelet restart pod UID: %v", originalPodUID)

kubeletRestartCmd := []string{
"chroot",
"/rootfs",
Expand All @@ -362,6 +367,33 @@ var _ = Describe("[rfe_id:27363][performance] CPU Management", Ordered, func() {

testlog.Infof("post restart: finished cooldown time: %v", restartCooldownTime)

By("verify test pod comes back after kubelet restart")
Eventually(func() error {
var updatedPod corev1.Pod
err := testclient.DataPlaneClient.Get(ctx, client.ObjectKeyFromObject(testpod), &updatedPod)
if err != nil {
return fmt.Errorf("failed to get pod after restart: %v", err)
}

// Verify it's the same pod (same UID)
if updatedPod.UID != originalPodUID {
return fmt.Errorf("pod UID changed after restart: original=%v, current=%v", originalPodUID, updatedPod.UID)
}

// Verify pod is ready
if updatedPod.Status.Phase != corev1.PodRunning {
return fmt.Errorf("pod is not running after restart: phase=%v", updatedPod.Status.Phase)
}
// Check pod ready condition
for _, condition := range updatedPod.Status.Conditions {
if condition.Type == corev1.PodReady && condition.Status != corev1.ConditionTrue {
return fmt.Errorf("Pod condition is not in Ready state after kubelet restart: reason: %v, message: %v", condition.Reason, condition.Message)

}
}
return nil
}).WithTimeout(5*time.Minute).WithPolling(10*time.Second).Should(Succeed(), "test pod should come back after kubelet restart")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not a bug, but the pod never went anywhere :) It should be still present and up.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we are only checking if the pod is still in running state after kubelet restart


By("fetch Default cpuset from cpu manager state after restart")
cpuManagerCpusetAfterRestart, err := nodes.CpuManagerCpuSet(ctx, workerRTNode)
Expect(err).ToNot(HaveOccurred())
Expand Down