Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release-4.12] OCPBUGS-15644: Update TestAWSELBConnectionIdleTimeout to not use wildcard DNS record #959

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 15 additions & 4 deletions test/e2e/operator_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2641,10 +2641,17 @@ func TestAWSELBConnectionIdleTimeout(t *testing.T) {
t.Fatalf("expected %s=%s, found %s=%s", key, expected, key, v)
}

// Make sure we can resolve the route's host name. It may take some
// time for the ingresscontroller's wildcard DNS record to propagate.
// Get the ELB's hostname via the wildcard DNS record
wildcardRecordName := controller.WildcardDNSRecordName(ic)
wildcardRecord := &iov1.DNSRecord{}
if err := kclient.Get(context.TODO(), wildcardRecordName, wildcardRecord); err != nil {
t.Fatalf("failed to get wildcard dnsrecord %s: %v", wildcardRecordName, err)
}
elbHostname := wildcardRecord.Spec.Targets[0]

// Wait until we can resolve the ELB's hostname
if err := wait.PollImmediate(5*time.Second, 5*time.Minute, func() (bool, error) {
_, err := net.LookupIP(route.Spec.Host)
_, err := net.LookupIP(elbHostname)
if err != nil {
t.Log(err)
return false, nil
Expand All @@ -2657,10 +2664,14 @@ func TestAWSELBConnectionIdleTimeout(t *testing.T) {

// Open a connection to the route, send a request, and verify that the
// connection times out after ~10 seconds.
request, err := http.NewRequest("GET", "http://"+route.Spec.Host, nil)
request, err := http.NewRequest("GET", "http://"+elbHostname, nil)
if err != nil {
t.Fatalf("failed to create HTTP request: %v", err)
}
// Add the "Host" header to direct request to ELB to the route we are testing which bypasses the need
// for the wildcard DNS record to propagate to the CI test runner cluster's DNS servers which has gotten very slow.
// See https://issues.redhat.com/browse/OCPBUGS-13810
request.Host = route.Spec.Host

client := &http.Client{}

Expand Down