diff --git a/src/cloud-api-adaptor/test/e2e/assessment_runner.go b/src/cloud-api-adaptor/test/e2e/assessment_runner.go index 97281237f..d2cf345b3 100644 --- a/src/cloud-api-adaptor/test/e2e/assessment_runner.go +++ b/src/cloud-api-adaptor/test/e2e/assessment_runner.go @@ -277,7 +277,7 @@ func (tc *TestCase) Run() { t.Fatal(err) } if err = wait.For(conditions.New(client.Resources()).PodPhaseMatch(tc.pod, tc.podState), wait.WithTimeout(WAIT_POD_RUNNING_TIMEOUT)); err != nil { - t.Fatal(err) + t.Error(err) } if tc.podState == v1.PodRunning || len(tc.testCommands) > 0 { t.Logf("Waiting for containers in pod: %v are ready", tc.pod.Name) @@ -285,11 +285,11 @@ func (tc *TestCase) Run() { //Added logs for debugging nightly tests clientset, err := kubernetes.NewForConfig(client.RESTConfig()) if err != nil { - t.Fatal(err) + t.Error(err) } pod, err := clientset.CoreV1().Pods(tc.pod.Namespace).Get(ctx, tc.pod.Name, metav1.GetOptions{}) if err != nil { - t.Fatal(err) + t.Error(err) } t.Logf("Expected Pod State: %v", tc.podState) yamlData, err := yaml.Marshal(pod.Status) @@ -304,7 +304,7 @@ func (tc *TestCase) Run() { t.Log(podLogString) t.Logf("===================\n") } - t.Fatal(err) + t.Error(err) } } } @@ -439,13 +439,13 @@ func (tc *TestCase) Run() { for _, extraPod := range tc.extraPods { if extraPod.imagePullTimer { // TBD - t.Fatal("Please implement assess logic for imagePullTimer") + t.Error("Please implement assess logic for imagePullTimer") } if extraPod.expectedPodLogString != "" { LogString, err := ComparePodLogString(ctx, client, extraPod.pod, extraPod.expectedPodLogString) if err != nil { t.Logf("Output:%s", LogString) - t.Fatal(err) + t.Error(err) } t.Logf("Log output of peer pod:%s", LogString) } @@ -454,7 +454,7 @@ func (tc *TestCase) Run() { logString, err := AssessPodTestCommands(ctx, client, extraPod.pod, extraPod.testCommands) t.Logf("Output when execute test commands:%s", logString) if err != nil { - t.Fatal(err) + t.Error(err) } } tc.assert.HasPodVM(t, extraPod.pod.Name) @@ -462,7 +462,7 @@ func (tc *TestCase) Run() { if tc.isNydusSnapshotter { // TBD - t.Fatal("Error: isNydusSnapshotter hasn't been implemented in extraPods. Please implement assess function for isNydusSnapshotter.") + t.Error("Error: isNydusSnapshotter hasn't been implemented in extraPods. Please implement assess function for isNydusSnapshotter.") } } } @@ -476,7 +476,7 @@ func (tc *TestCase) Run() { if tc.configMap != nil { if err = client.Resources().Delete(ctx, tc.configMap); err != nil { - t.Fatal(err) + t.Error(err) } t.Logf("Deleting Configmap... %s", tc.configMap.Name) @@ -484,7 +484,7 @@ func (tc *TestCase) Run() { if tc.secret != nil { if err = client.Resources().Delete(ctx, tc.secret); err != nil { - t.Fatal(err) + t.Error(err) } else { t.Logf("Deleting Secret... %s", tc.secret.Name) } @@ -496,14 +496,14 @@ func (tc *TestCase) Run() { t.Fatal(err) } if err = clientSet.CoreV1().Secrets(E2eNamespace).Delete(ctx, DEFAULT_AUTH_SECRET, metav1.DeleteOptions{}); err != nil { - t.Fatal(err) + t.Error(err) } } if tc.extraSecrets != nil { for _, extraSecret := range tc.extraSecrets { if err = client.Resources().Delete(ctx, extraSecret); err != nil { - t.Fatal(err) + t.Error(err) } else { t.Logf("Deleting extra Secret... %s", extraSecret.Name) } @@ -525,13 +525,13 @@ func (tc *TestCase) Run() { } if err = client.Resources().Delete(ctx, tc.job); err != nil { - t.Fatal(err) + t.Error(err) } else { t.Logf("Deleting Job... %s", tc.job.Name) } for _, pod := range podList.Items { if err = client.Resources().Delete(ctx, &pod); err != nil { - t.Fatal(err) + t.Error(err) } t.Logf("Deleting pods created by job... %s", pod.ObjectMeta.Name) } @@ -544,14 +544,14 @@ func (tc *TestCase) Run() { } if err = client.Resources().Delete(ctx, tc.pod); err != nil { - t.Fatal(err) + t.Error(err) } t.Logf("Deleting pod %s...", tc.pod.Name) if err = wait.For(conditions.New( client.Resources()).ResourceDeleted(tc.pod), wait.WithInterval(5*time.Second), wait.WithTimeout(tc.deletionWithin)); err != nil { - t.Fatal(err) + t.Error(err) } t.Logf("Pod %s has been successfully deleted within %.0fs", tc.pod.Name, tc.deletionWithin.Seconds()) } @@ -563,7 +563,7 @@ func (tc *TestCase) Run() { err := DeletePod(ctx, client, pod, &tc.deletionWithin) if err != nil { t.Logf("Error occurs when delete pod: %s", extraPod.pod.Name) - t.Fatal(err) + t.Error(err) } t.Logf("Pod %s has been successfully deleted within %.0fs", pod.Name, tc.deletionWithin.Seconds()) } @@ -571,7 +571,7 @@ func (tc *TestCase) Run() { if tc.pvc != nil { if err = client.Resources().Delete(ctx, tc.pvc); err != nil { - t.Fatal(err) + t.Error(err) } else { t.Logf("Deleting PVC... %s", tc.pvc.Name) } @@ -579,7 +579,7 @@ func (tc *TestCase) Run() { if tc.service != nil { if err = client.Resources().Delete(ctx, tc.service); err != nil { - t.Fatal(err) + t.Error(err) } else { t.Logf("Deleting Service... %s", tc.service.Name) }