Commit 19034be5 authored by Derek Nola's avatar Derek Nola

Improve error checks around FetchIngressIP

parent 5c23df63
...@@ -350,6 +350,9 @@ func FetchIngressIP(kubeconfig string) ([]string, error) { ...@@ -350,6 +350,9 @@ func FetchIngressIP(kubeconfig string) ([]string, error) {
} }
ingressIP := strings.Trim(res, " ") ingressIP := strings.Trim(res, " ")
ingressIPs := strings.Split(ingressIP, " ") ingressIPs := strings.Split(ingressIP, " ")
if len(ingressIPs) == 0 {
return nil, errors.New("no ingress IP found")
}
return ingressIPs, nil return ingressIPs, nil
} }
......
...@@ -97,9 +97,13 @@ var _ = Describe("Verify K3s can run Wasm workloads", Ordered, func() { ...@@ -97,9 +97,13 @@ var _ = Describe("Verify K3s can run Wasm workloads", Ordered, func() {
}) })
It("Interact with Wasm applications", func() { It("Interact with Wasm applications", func() {
ingressIPs, err := e2e.FetchIngressIP(tc.KubeConfigFile) var ingressIPs []string
Expect(err).NotTo(HaveOccurred()) var err error
Expect(ingressIPs).To(HaveLen(1)) Eventually(func(g Gomega) {
ingressIPs, err = e2e.FetchIngressIP(tc.KubeConfigFile)
g.Expect(err).NotTo(HaveOccurred())
g.Expect(ingressIPs).To(HaveLen(1))
}, "120s", "5s").Should(Succeed())
endpoints := []string{"slight/hello", "spin/go-hello", "spin/hello"} endpoints := []string{"slight/hello", "spin/go-hello", "spin/hello"}
for _, endpoint := range endpoints { for _, endpoint := range endpoints {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment