From 3ac57097f61b1a1dcdae9146ca10323fb7ef6907 Mon Sep 17 00:00:00 2001 From: Kevin Pullin Date: Sun, 17 Feb 2019 20:32:27 -0800 Subject: [PATCH] Add 'waitForLuaSync' sleep in external name TCP test --- test/e2e/tcpudp/tcp.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/e2e/tcpudp/tcp.go b/test/e2e/tcpudp/tcp.go index 23a75b947..df93ca776 100644 --- a/test/e2e/tcpudp/tcp.go +++ b/test/e2e/tcpudp/tcp.go @@ -22,6 +22,7 @@ import ( "github.com/parnurzeal/gorequest" "net" "strings" + "time" corev1 "k8s.io/api/core/v1" metav1 "k8s.io/apimachinery/pkg/apis/meta/v1" @@ -33,6 +34,10 @@ import ( "k8s.io/ingress-nginx/test/e2e/framework" ) +const ( + waitForLuaSync = 5 * time.Second +) + var _ = framework.IngressNginxDescribe("TCP Feature", func() { f := framework.NewDefaultFramework("tcp") @@ -164,6 +169,8 @@ var _ = framework.IngressNginxDescribe("TCP Feature", func() { Update(config) Expect(err).NotTo(HaveOccurred(), "unexpected error updating configmap") + time.Sleep(waitForLuaSync) + // Validate that the generated nginx config contains the expected `proxy_upstream_name` value f.WaitForNginxConfiguration( func(cfg string) bool { @@ -183,6 +190,7 @@ var _ = framework.IngressNginxDescribe("TCP Feature", func() { }, } ips, err := resolver.LookupHost(context.Background(), "google-public-dns-b.google.com") + Expect(err).NotTo(HaveOccurred(), "unexpected error from DNS resolver") Expect(ips).Should(ContainElement("8.8.4.4")) })