Skip to content

Commit 77b1656

Browse files
authored
Merge pull request #888 from mboersma/restore-elb-connect-test
Revert "skip LB direct connect test temporarily"
2 parents be6da12 + 14af81a commit 77b1656

File tree

3 files changed

+23
-13
lines changed

3 files changed

+23
-13
lines changed

go.mod

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ require (
1414
github.com/google/go-cmp v0.5.1
1515
github.com/google/gofuzz v1.1.0
1616
github.com/google/uuid v1.1.1
17+
github.com/hashicorp/go-retryablehttp v0.6.6
1718
github.com/onsi/ginkgo v1.14.0
1819
github.com/onsi/gomega v1.10.1
1920
github.com/pkg/errors v0.9.1

go.sum

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,12 @@ github.com/grpc-ecosystem/go-grpc-middleware v1.0.1-0.20190118093823-f849b5445de
289289
github.com/grpc-ecosystem/go-grpc-prometheus v1.2.0/go.mod h1:8NvIoxWQoOIhqOTXgfV/d3M/q6VIi02HzZEHgUlZvzk=
290290
github.com/grpc-ecosystem/grpc-gateway v1.9.0/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
291291
github.com/grpc-ecosystem/grpc-gateway v1.9.5/go.mod h1:vNeuVxBJEsws4ogUvrchl83t/GYV9WGTSLVdBhOQFDY=
292+
github.com/hashicorp/go-cleanhttp v0.5.1 h1:dH3aiDG9Jvb5r5+bYHsikaOUIpcM0xvgMXVoDkXMzJM=
293+
github.com/hashicorp/go-cleanhttp v0.5.1/go.mod h1:JpRdi6/HCYpAwUzNwuwqhbovhLtngrth3wmdIIUrZ80=
294+
github.com/hashicorp/go-hclog v0.9.2 h1:CG6TE5H9/JXsFWJCfoIVpKFIkFe6ysEuHirp4DxCsHI=
295+
github.com/hashicorp/go-hclog v0.9.2/go.mod h1:5CU+agLiy3J7N7QjHK5d05KxGsuXiQLrjA0H7acj2lQ=
296+
github.com/hashicorp/go-retryablehttp v0.6.6 h1:HJunrbHTDDbBb/ay4kxa1n+dLmttUlnP3V9oNE4hmsM=
297+
github.com/hashicorp/go-retryablehttp v0.6.6/go.mod h1:vAew36LZh98gCBJNLH42IQ1ER/9wtLZZ8meHqQvEYWY=
292298
github.com/hashicorp/go-syslog v1.0.0/go.mod h1:qPfqrKkXGihmCqbJM2mZgkZGvKG1dFdvsLplgctolz4=
293299
github.com/hashicorp/golang-lru v0.0.0-20180201235237-0fb14efe8c47/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
294300
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=

test/e2e/azure_lb.go

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,15 @@ package e2e
2020

2121
import (
2222
"context"
23+
"fmt"
24+
"io/ioutil"
2325
"net"
26+
"regexp"
2427

2528
. "github.com/onsi/ginkgo"
2629
. "github.com/onsi/gomega"
2730

31+
retryablehttp "github.com/hashicorp/go-retryablehttp"
2832
appsv1 "k8s.io/api/apps/v1"
2933
batchv1 "k8s.io/api/batch/v1"
3034
corev1 "k8s.io/api/core/v1"
@@ -260,19 +264,18 @@ func AzureLBSpec(ctx context.Context, inputGetter func() AzureLBSpecInput) {
260264
}
261265
WaitForJobComplete(context.TODO(), elbJobInput, e2eConfig.GetIntervals(specName, "wait-job")...)
262266

263-
By("SKIPPED: connecting directly to the external LB service")
264-
// Temporarily disabled while we investigate some frequent failures.
265-
// url := fmt.Sprintf("http://%s", elbIP)
266-
// resp, err := retryablehttp.Get(url)
267-
// if resp != nil {
268-
// defer resp.Body.Close()
269-
// }
270-
// Expect(err).NotTo(HaveOccurred())
271-
// body, err := ioutil.ReadAll(resp.Body)
272-
// Expect(err).NotTo(HaveOccurred())
273-
// matched, err := regexp.MatchString("(Welcome to nginx)", string(body))
274-
// Expect(err).NotTo(HaveOccurred())
275-
// Expect(matched).To(BeTrue())
267+
By("connecting directly to the external LB service")
268+
url := fmt.Sprintf("http://%s", elbIP)
269+
resp, err := retryablehttp.Get(url)
270+
if resp != nil {
271+
defer resp.Body.Close()
272+
}
273+
Expect(err).NotTo(HaveOccurred())
274+
body, err := ioutil.ReadAll(resp.Body)
275+
Expect(err).NotTo(HaveOccurred())
276+
matched, err := regexp.MatchString("(Welcome to nginx)", string(body))
277+
Expect(err).NotTo(HaveOccurred())
278+
Expect(matched).To(BeTrue())
276279

277280
if input.SkipCleanup {
278281
return

0 commit comments

Comments
 (0)