Skip to content
This repository has been archived by the owner on Oct 10, 2023. It is now read-only.

Commit

Permalink
Fix flaky package plugin tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Haoran Li committed Sep 20, 2022
1 parent 6ab1811 commit 2ed3857
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions cmd/cli/plugin/package/test/package_plugin_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -488,37 +488,37 @@ func setUpPrivateRegistry(kubeconfigPath, clusterName string) {
}
}

By("make sure package API is available after kapp-controller restart")
By("make sure registry pod is running")
err = retry.OnError(
backOff,
func(err error) bool {
return err != nil
},
func() error {
result = packagePlugin.ListRepository(&repoOptions)
if result.Error != nil {
return result.Error
podList, err := clientSet.CoreV1().Pods(registryNamespace).List(context.Background(), metav1.ListOptions{})
if err != nil {
return err
}

for _, pod := range podList.Items {
if pod.Status.Phase != corev1.PodRunning {
return errors.New("registry pod is not running")
}
}
return nil
})
Expect(err).ToNot(HaveOccurred())

By("make sure registry pod is running")
By("make sure package API is available after kapp-controller restart")
err = retry.OnError(
backOff,
func(err error) bool {
return err != nil
},
func() error {
podList, err := clientSet.CoreV1().Pods(registryNamespace).List(context.Background(), metav1.ListOptions{})
if err != nil {
return err
}

for _, pod := range podList.Items {
if pod.Status.Phase != corev1.PodRunning {
return errors.New("registry pod is not running")
}
result = packagePlugin.ListRepository(&repoOptions)
if result.Error != nil {
return result.Error
}
return nil
})
Expand Down

0 comments on commit 2ed3857

Please # to comment.