Skip to content

Bug 2039919: NE-542 Router compression E2E test#679

Merged
openshift-merge-robot merged 1 commit intoopenshift:masterfrom
candita:NE-542-RouterCompE2ETest
Jan 21, 2022
Merged

Bug 2039919: NE-542 Router compression E2E test#679
openshift-merge-robot merged 1 commit intoopenshift:masterfrom
candita:NE-542-RouterCompE2ETest

Conversation

@candita
Copy link
Contributor

@candita candita commented Nov 17, 2021

Test the canary route to see if it will return a "Content-Encoding: gzip" header when the "Accept-Encoding: gzip" header is sent, and the new HTTPCompressionPolicy.MimeTypes includes the mime type of the canary route (which is "text/plain; charset=utf-8").

Also clean up a comment in util.go and export the getMIMETypes method in deployment.go for use in tests.

@openshift-ci openshift-ci bot requested review from alebedev87 and knobunc November 17, 2021 03:00
@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Nov 17, 2021
@candita candita force-pushed the NE-542-RouterCompE2ETest branch from 24e5731 to 079f89c Compare November 17, 2021 03:01
@candita
Copy link
Contributor Author

candita commented Nov 17, 2021

evel=error msg=When applying changes to module.vpc.aws_vpc.new_vpc[0], provider
level=error msg="registry.terraform.io/-/aws" produced an unexpected new value for was
level=error msg=present, but now absent.

/test e2e-aws-operator

@candita
Copy link
Contributor Author

candita commented Nov 17, 2021

=== RUN TestUniqueIdHeader
operator_test.go:1924: failed to read output from pod unique-id-header-test-1: container "curl" in pod "unique-id-header-test-1" is waiting to start: ContainerCreating
operator_test.go:1924: failed to read output from pod unique-id-header-test-1: container "curl" in pod "unique-id-header-test-1" is waiting to start: ContainerCreating
operator_test.go:1924: failed to read output from pod unique-id-header-test-1: container "curl" in pod "unique-id-header-test-1" is waiting to start: ContainerCreating
operator_test.go:1944: failed to observe the expected log message: timed out waiting for the condition
panic.go:632: deleted ingresscontroller uniqueid
--- FAIL: TestUniqueIdHeader (337.49s)

/test e2e-aws-operator

@candita
Copy link
Contributor Author

candita commented Nov 17, 2021

Again:
=== RUN TestUniqueIdHeader
operator_test.go:1924: failed to read output from pod unique-id-header-test-1: container "curl" in pod "unique-id-header-test-1" is waiting to start: ContainerCreating
operator_test.go:1924: failed to read output from pod unique-id-header-test-1: container "curl" in pod "unique-id-header-test-1" is waiting to start: ContainerCreating
operator_test.go:1924: failed to read output from pod unique-id-header-test-1: container "curl" in pod "unique-id-header-test-1" is waiting to start: ContainerCreating
operator_test.go:1944: failed to observe the expected log message: timed out waiting for the condition
panic.go:632: deleted ingresscontroller uniqueid
--- FAIL: TestUniqueIdHeader (337.49s)

/test e2e-aws-operator

@candita
Copy link
Contributor Author

candita commented Nov 17, 2021

/test e2e-aws-operator

@candita
Copy link
Contributor Author

candita commented Nov 17, 2021

level=error msg=Error: Provider produced inconsistent result after apply
level=error
level=error msg=When applying changes to module.vpc.aws_route_table.private_routes[1],
level=error msg=provider "registry.terraform.io/-/aws" produced an unexpected new value for
level=error msg=was present, but now absent.
level=error msg=This is a bug in the provider, which should be reported in the provider's own
level=error msg=issue tracker.
..
level=error msg=Error: Error creating network Load Balancer: InvalidSubnet: VPC vpc-02985868a46f2e808 has no internet gateway
level=error msg= status code: 400, request id: d7a179b6-cba4-4ad2-b537-a61b637d2dbc
level=error msg= on ../tmp/openshift-install-cluster-229032808/vpc/master-elb.tf line 22, in resource "aws_lb" "api_external":
level=error msg= 22: resource "aws_lb" "api_external" {
level=fatal msg=failed to fetch Cluster: failed to generate asset "Cluster": failed to create cluster: failed to apply Terraform: failed to complete the change

/test e2e-aws-operator

@candita
Copy link
Contributor Author

candita commented Nov 18, 2021

Still a terraform error. No answer to query on 4-dev-triage, just trying again in hopes something was fixed but not reported.
/test e2e-aws-operator

@candita
Copy link
Contributor Author

candita commented Nov 18, 2021

Now a must-gather error.

[36mINFO�[0m[2021-11-18T16:42:00Z] Running must-gather...
error running backup collection: errors ocurred while gathering data:
[skipping gathering serviceaccounts/cluster-capi-operator due to error: a resource cannot be retrieved by name across all namespaces, skipping gathering configmaps/cluster-capi-operator-images due to error: a resource cannot be retrieved by name across all namespaces, skipping gathering deployments.apps/cluster-capi-operator due to error: a resource cannot be retrieved by name across all namespaces, skipping gathering namespaces/openshift-dns due to error: one or more errors ocurred while gathering pod-specific data for namespace: openshift-dns

[one or more errors ocurred while gathering container data for pod dns-default-7928s:

[Get "https://10.0.189.3:10250/containerLogs/openshift-dns/dns-default-7928s/dns?timestamps=true": dial tcp 10.0.189.3:10250: connect: connection refused, Get "https://10.0.189.3:10250/containerLogs/openshift-dns/dns-default-7928s/dns?previous=true&timestamps=true": dial tcp 10.0.189.3:10250: connect: connection refused, Get "https://10.0.189.3:10250/containerLogs/openshift-dns/dns-default-7928s/kube-rbac-proxy?timestamps=true": dial tcp 10.0.189.3:10250: connect: connection refused, Get "https://10.0.189.3:10250/containerLogs/openshift-dns/dns-default-7928s/kube-rbac-proxy?previous=true&timestamps=true": dial tcp 10.0.189.3:10250: connect: connection refused], one or more errors ocurred while gathering container data for pod node-resolver-mswbn:

/test e2e-aws-operator

@candita
Copy link
Contributor Author

candita commented Nov 18, 2021

2021-11-18T21:49:03.646551+00:00 router-headercapture-69589878c5-9dtrr router-headercapture-69589878c5-9dtrr haproxy[174]: Server be_edge_http:openshift-ingress-canary:canary/pod:ingress-canary-kjkbg:ingress-canary:8080-tcp:10.129.2.6:8080 is DOWN, reason: Layer4 connection problem, info: "Connection refused", check duration: 0ms. 2 active and 0 backup servers left. 0 sessions active, 0 requeued, 0 remaining in queue.
operator_test.go:1652: failed to observe the expected log message: timed out waiting for the condition
panic.go:613: deleted ingresscontroller headercapture
--- FAIL: TestHTTPHeaderCapture (273.49s)

/test e2e-aws-operator

}

if header.Get("Content-Encoding") == "gzip" {
t.Logf("compression is enabled and shouldn't be for %s", r.Name)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn't this an error? Shouldn't this branch call t.Errorf or at least return an error?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, thanks!

Comment on lines 142 to 236
if err := wait.PollImmediate(2*time.Second, 5*time.Minute, func() (bool, error) {
header, code, err := getHttp(client, r, true)
if err != nil {
t.Logf("GET %s failed: %v, retrying...", r.Spec.Host, err)
return false, nil
}
if code != http.StatusOK {
t.Logf("GET %s failed: status %v, expected %v, retrying...", r.Spec.Host, code, http.StatusOK)
return false, nil // retry on 503 as pod/service may not be ready
}

if header.Get("Content-Encoding") != "gzip" {
t.Fatalf("compression is not enabled but should be for %s", r.Name)
}
t.Logf("compression is properly enabled for %s", r.Name)

return true, nil
}); err != nil {
t.Fatalf("failed to get results on GET: %v", err)
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider refactoring this into a helper with, e.g., an "expectedContentEncoding" parameter.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, will do.

Comment on lines 164 to 165
// Get HTTP Headers. If the request includes a Header of "Accept-Encoding: gzip" and the route
// mimeType matches the ingress setting, we should see "Content-Encoding: gzip" in the response.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The godoc suggests that getHttp looks at the response headers to check for Content-Encoding: gzip, but getHttp doesn't look at the response headers at all.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will change godoc.

return response.Header, response.StatusCode, nil
}

// Update the spec.httpCompressionPolicy with different MIME types
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This godoc doesn't seem accurate. It isn't clear what testCompressionPolicy is intended to do, but it looks like it verifies that the ingress operator correctly configures OpenShift router with the given compression MIME types by (1) creating a new ingresscontroller with the MIME types and (2) verifying that the ingresscontroller becomes available, which means that HAProxy was able to parse the configuration. Is my understanding correct?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, will update godoc

}

// Update the spec.httpCompressionPolicy with different MIME types
func testCompressionPolicy(t *testing.T, icName types.NamespacedName, domain string, compressionPolicy operatorv1.HTTPCompressionPolicy) error {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Call t.Helper() at the start of the function.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

Comment on lines 210 to 225
p := ic.Spec.HTTPCompression
var found bool
for _, given := range compressionPolicy.MimeTypes {
found = false
for _, stored := range p.MimeTypes {
if given == stored {
found = true
break
}
}
if !found {
t.Fatalf("did not find mimeType: %s, found: %v\n", given, p.MimeTypes)
}
}
t.Logf("successfully created %s with MIME types: %v\n", ic.Name, ingresscontroller.GetMIMETypes(p.MimeTypes))
return nil
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the point of this logic? testCompressionPolicy assigns ic.Spec.HTTPCompression = compressionPolicy above, so it seems like this logic is just checking that the value that was assigned to ic.Spec.HTTPCompression matches the value that is in ic.Spec.HTTPCompression, which should be the same value anyway. If you want to verify that the MIME types are set on the router deployment, you could use waitForDeploymentEnvVar.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I'll use waitForDeploymentEnvVar, I hadn't considered that was possible.

Comment on lines 64 to 177
// Test some other compression policies for the ingress config
mimeTypesNormative := []operatorv1.CompressionMIMEType{"text/html", "application/json", "x-custom/allow-custom"}
compressionPolicyNormative := operatorv1.HTTPCompressionPolicy{MimeTypes: mimeTypesNormative}

mimeTypesEmpty := []operatorv1.CompressionMIMEType{}
compressionPolicyEmpty := operatorv1.HTTPCompressionPolicy{MimeTypes: mimeTypesEmpty}

mimeTypesNeedQuotes := []operatorv1.CompressionMIMEType{`text/html; v="keepquoted"`, `x-custom/allow-custom; specialChar='`}
compressionPolicyNeedQuotes := operatorv1.HTTPCompressionPolicy{MimeTypes: mimeTypesNeedQuotes}

mimeTypesErrors := []operatorv1.CompressionMIMEType{"text/", "x- /value", "//"}
compressionPolicyErrors := operatorv1.HTTPCompressionPolicy{MimeTypes: mimeTypesErrors}

icName := types.NamespacedName{Namespace: operatorNamespace, Name: "http-compression-1"}
domain := icName.Name + "." + dnsConfig.Spec.BaseDomain
if err := testCompressionPolicy(t, icName, domain, compressionPolicyNormative); err != nil {
log.Fatalf("error testing normal compression policy: %v", err)
}

icName = types.NamespacedName{Namespace: operatorNamespace, Name: "http-compression-2"}
domain = icName.Name + "." + dnsConfig.Spec.BaseDomain
if err := testCompressionPolicy(t, icName, domain, compressionPolicyEmpty); err != nil {
log.Fatalf("error testing empty compression policy: %v", err)
}

icName = types.NamespacedName{Namespace: operatorNamespace, Name: "http-compression-3"}
domain = icName.Name + "." + dnsConfig.Spec.BaseDomain
if err := testCompressionPolicy(t, icName, domain, compressionPolicyNeedQuotes); err != nil {
log.Fatalf("error testing compression policy that needs quotes: %v", err)
}

icName = types.NamespacedName{Namespace: operatorNamespace, Name: "http-compression-4"}
domain = icName.Name + "." + dnsConfig.Spec.BaseDomain
if err := testCompressionPolicy(t, icName, domain, compressionPolicyErrors); err == nil {
log.Fatalf("compression policy with errors should have failed but didn't")
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like this block is one test, and the lines above this block and the lines below this block are another test. Could this block be moved to the end of the test function or to a separate test function?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, thanks.

icName := types.NamespacedName{Namespace: operatorNamespace, Name: "http-compression-1"}
domain := icName.Name + "." + dnsConfig.Spec.BaseDomain
if err := testCompressionPolicy(t, icName, domain, compressionPolicyNormative); err != nil {
log.Fatalf("error testing normal compression policy: %v", err)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tests usually don't use log. Why not use t here and below?

Suggested change
log.Fatalf("error testing normal compression policy: %v", err)
t.Errorf("error testing normal compression policy: %v", err)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

@candita candita force-pushed the NE-542-RouterCompE2ETest branch from 079f89c to b56b794 Compare December 9, 2021 02:52
@candita
Copy link
Contributor Author

candita commented Dec 9, 2021

@Miciah I made all changes you requested. Please take a final look.

@candita
Copy link
Contributor Author

candita commented Dec 9, 2021

/retest-required

@candita candita force-pushed the NE-542-RouterCompE2ETest branch from b56b794 to 5edc437 Compare December 10, 2021 00:16
@candita
Copy link
Contributor Author

candita commented Dec 10, 2021

/retest

@candita
Copy link
Contributor Author

candita commented Dec 13, 2021

/retest-required

)

func TestRouterCompressionParsing(t *testing.T) {
t.Helper()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

t.Helper() should be called in the helper functions, not in the test function itself.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏼

Comment on lines 45 to 52
pc4, err := getPrivateController(t, "http-compression-4", dnsConfig.Spec.BaseDomain)
if err != nil {
t.Fatalf("error getting private controller: %v", err)
}
if err := testCompressionPolicy(t, "http-compression-4", compressionPolicyErrors); err == nil {
t.Errorf("compression policy with errors should have failed but didn't")
}
defer assertIngressControllerDeleted(t, kclient, pc4)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
pc4, err := getPrivateController(t, "http-compression-4", dnsConfig.Spec.BaseDomain)
if err != nil {
t.Fatalf("error getting private controller: %v", err)
}
if err := testCompressionPolicy(t, "http-compression-4", compressionPolicyErrors); err == nil {
t.Errorf("compression policy with errors should have failed but didn't")
}
defer assertIngressControllerDeleted(t, kclient, pc4)
pc4, err := getPrivateController(t, "http-compression-4", dnsConfig.Spec.BaseDomain)
if err != nil {
t.Fatalf("error getting private controller: %v", err)
}
defer assertIngressControllerDeleted(t, kclient, pc4)
if err := testCompressionPolicy(t, "http-compression-4", compressionPolicyErrors); err == nil {
t.Errorf("compression policy with errors should have failed but didn't")
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏼

defer assertIngressControllerDeleted(t, kclient, pc)
}

func getPrivateController(t *testing.T, privateName string, privateDomain string) (*operatorv1.IngressController, error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider renaming this function as createPrivateController to convey that it doesn't just get an existing ingresscontroller but rather creates a new one.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏼

ic := newPrivateController(icName, domain)
// Create a new private Ingress Controller (deletion handled by caller)
if err := kclient.Create(context.TODO(), ic); err != nil {
return ic, errors.New(fmt.Sprintf("error creating private ingresscontroller %s: %v", privateName, err))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return ic, errors.New(fmt.Sprintf("error creating private ingresscontroller %s: %v", privateName, err))
return ic, fmt.Errorf("error creating private ingresscontroller %s: %v", privateName, err)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:+1

t.Logf("failed to get ingress controller: %v, retrying...", err)
return false, nil
}
ic.Spec.HTTPCompression = compressionPolicy
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ic.Spec.HTTPCompression = compressionPolicy
compressionPolicy.DeepCopyInto(&ic.Spec.HTTPCompression)

See #689 for why this sort of assignment is problematic.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏼


// curl to canary, without the Accept-Encoding header set to gzip
if err := testContentEncoding(t, client, r, false, ""); err != nil {
t.Errorf(err.Error())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
t.Errorf(err.Error())
t.Error(err)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏼


// curl to canary, WITH the Accept-Encoding header set to gzip
if err := testContentEncoding(t, client, r, true, "gzip"); err != nil {
t.Errorf(err.Error())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
t.Errorf(err.Error())
t.Error(err)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

}

func TestRouterCompressionOperation(t *testing.T) {
t.Helper()
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't call t.Helper() in the test function.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏼


contentEncoding := header.Get("Content-Encoding")
if contentEncoding != expectedContentEncoding {
return false, errors.New(fmt.Sprintf("compression error: expected \"%s\", got \"%s\" for %s route", expectedContentEncoding, contentEncoding, route.Name))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return false, errors.New(fmt.Sprintf("compression error: expected \"%s\", got \"%s\" for %s route", expectedContentEncoding, contentEncoding, route.Name))
return false, fmt.Errorf("compression error: expected %q, got %q for %s route", expectedContentEncoding, contentEncoding, route.Name)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

return nil
}

// getHTTPHeaders returns the HTTP Headers, and first adds the request header "Accept-Encoding: gzip" if requested.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// getHTTPHeaders returns the HTTP Headers, and first adds the request header "Accept-Encoding: gzip" if requested.
// getHttpHeaders returns the HTTP Headers, and first adds the request header "Accept-Encoding: gzip" if requested.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@candita candita force-pushed the NE-542-RouterCompE2ETest branch from 5edc437 to 2f3e759 Compare January 11, 2022 23:31
@candita
Copy link
Contributor Author

candita commented Jan 12, 2022

The single-node e2e job is failing during installation about 50% of the runs:
https://coreos.slack.com/archives/C018KQE33MF/p1640173046174300

/retest

@candita candita changed the title NE-542 Router compression E2E test Bug 2039919: NE-542 Router compression E2E test Jan 12, 2022
@openshift-ci openshift-ci bot added the bugzilla/severity-medium Referenced Bugzilla bug's severity is medium for the branch this PR is targeting. label Jan 12, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 12, 2022

@candita: This pull request references Bugzilla bug 2039919, which is invalid:

  • expected the bug to target the "4.10.0" release, but it targets "---" instead

Comment /bugzilla refresh to re-evaluate validity if changes to the Bugzilla bug are made, or edit the title of this pull request to link to a different bug.

Details

In response to this:

Bug 2039919: NE-542 Router compression E2E test

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci openshift-ci bot added the bugzilla/invalid-bug Indicates that a referenced Bugzilla bug is invalid for the branch this PR is targeting. label Jan 12, 2022
@candita
Copy link
Contributor Author

candita commented Jan 12, 2022

/bugzilla refresh

@openshift-ci openshift-ci bot added the bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. label Jan 12, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 12, 2022

@candita: This pull request references Bugzilla bug 2039919, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target release (4.10.0) matches configured target release for branch (4.10.0)
  • bug is in the state NEW, which is one of the valid states (NEW, ASSIGNED, ON_DEV, POST, POST)

Requesting review from QA contact:
/cc @lihongan

Details

In response to this:

/bugzilla refresh

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@openshift-ci openshift-ci bot removed the bugzilla/invalid-bug Indicates that a referenced Bugzilla bug is invalid for the branch this PR is targeting. label Jan 12, 2022
@openshift-ci openshift-ci bot requested a review from lihongan January 12, 2022 18:01
@candita
Copy link
Contributor Author

candita commented Jan 12, 2022

The single-node e2e job is failing during installation about 50% of the runs:
https://coreos.slack.com/archives/C018KQE33MF/p1640173046174300

/retest

if err := wait.PollImmediate(10*time.Second, 1*time.Minute, func() (bool, error) {
ic, err := getIngressController(t, kclient, defaultName, 1*time.Minute)
if err != nil {
t.Fatalf("failed to get ingress controller: %v, retrying...", err)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

t.Fatalf will cause the test to fail and return immediately.

Suggested change
t.Fatalf("failed to get ingress controller: %v, retrying...", err)
t.Logf("failed to get ingress controller: %v, retrying...", err)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏼

Comment on lines 59 to 62
if err := testCompressionPolicy(t, name, policy); err != nil {
t.Errorf(errorMsg, err)
}
defer assertIngressControllerDeleted(t, kclient, pc)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tiny suggestion: the deferred cleanup should be grouped with the creation.

Suggested change
if err := testCompressionPolicy(t, name, policy); err != nil {
t.Errorf(errorMsg, err)
}
defer assertIngressControllerDeleted(t, kclient, pc)
defer assertIngressControllerDeleted(t, kclient, pc)
if err := testCompressionPolicy(t, name, policy); err != nil {
t.Errorf(errorMsg, err)
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍🏼

Comment on lines 99 to 104
if strings.Contains(err.Error(), "has been modified") {
t.Logf("failed to update ingress controller, retrying...")
return false, nil
}
// Return an error if validation failed
return true, err
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The "k8s.io/apimachinery/pkg/api/errors" package's IsInvalid function should work, but we can leave this as-is if you prefer. (Actually, maybe this logic should retry if errors.IsConflict(err) is true, and the caller could use errors.IsInvalid(err) on the returned error value if the caller expects an invalid error. Note that you would need to use %w in fmt.Errorf to wrap the error from kclient.Update so that errors.IsConflict could properly introspect it, I think. Anyway, this isn't critical for this PR, so we can leave it as-is.)

@candita candita force-pushed the NE-542-RouterCompE2ETest branch from 2f3e759 to 211b9c1 Compare January 20, 2022 18:48
@candita
Copy link
Contributor Author

candita commented Jan 21, 2022

level=error msg=Cluster operator authentication Degraded is True with IngressStateEndpoints_MissingSubsets::OAuthServerRouteEndpointAccessibleController_SyncError::OAuthServerServiceEndpointAccessibleController_SyncError::OAuthServerServiceEndpointsEndpointAccessibleController_SyncError::SystemServiceCAConfig_MissingCA: IngressStateEndpointsDegraded: No subsets found for the endpoints of oauth-server
level=error msg=OAuthServerRouteEndpointAccessibleControllerDegraded: Get "https://oauth-openshift.apps.ci-op-f6cwt9xi-31ebf.origin-ci-int-aws.dev.rhcloud.com/healthz": EOF
/retest e2e-upgrade

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 21, 2022

@candita: The /retest command does not accept any targets.
The following commands are available to trigger required jobs:

  • /test e2e-aws
  • /test e2e-aws-operator
  • /test e2e-gcp-serial
  • /test e2e-upgrade
  • /test images
  • /test unit
  • /test verify

The following commands are available to trigger optional jobs:

  • /test e2e-aws-single-node
  • /test e2e-azure
  • /test e2e-azure-operator
  • /test e2e-gcp-operator

Use /test all to run the following jobs that were automatically triggered:

  • pull-ci-openshift-cluster-ingress-operator-master-e2e-aws
  • pull-ci-openshift-cluster-ingress-operator-master-e2e-aws-operator
  • pull-ci-openshift-cluster-ingress-operator-master-e2e-aws-single-node
  • pull-ci-openshift-cluster-ingress-operator-master-e2e-gcp-serial
  • pull-ci-openshift-cluster-ingress-operator-master-e2e-upgrade
  • pull-ci-openshift-cluster-ingress-operator-master-images
  • pull-ci-openshift-cluster-ingress-operator-master-unit
  • pull-ci-openshift-cluster-ingress-operator-master-verify
Details

In response to this:

level=error msg=Cluster operator authentication Degraded is True with IngressStateEndpoints_MissingSubsets::OAuthServerRouteEndpointAccessibleController_SyncError::OAuthServerServiceEndpointAccessibleController_SyncError::OAuthServerServiceEndpointsEndpointAccessibleController_SyncError::SystemServiceCAConfig_MissingCA: IngressStateEndpointsDegraded: No subsets found for the endpoints of oauth-server
level=error msg=OAuthServerRouteEndpointAccessibleControllerDegraded: Get "https://oauth-openshift.apps.ci-op-f6cwt9xi-31ebf.origin-ci-int-aws.dev.rhcloud.com/healthz": EOF
/retest e2e-upgrade

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@candita
Copy link
Contributor Author

candita commented Jan 21, 2022

/test e2e-upgrade

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 21, 2022

@candita: all tests passed!

Full PR test history. Your PR dashboard.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@Miciah
Copy link
Contributor

Miciah commented Jan 21, 2022

Thanks!
/lgtm

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jan 21, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 21, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: candita, Miciah

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-robot openshift-merge-robot merged commit e243ca1 into openshift:master Jan 21, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 21, 2022

@candita: All pull requests linked via external trackers have merged:

Bugzilla bug 2039919 has been moved to the MODIFIED state.

Details

In response to this:

Bug 2039919: NE-542 Router compression E2E test

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. bugzilla/severity-medium Referenced Bugzilla bug's severity is medium for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. lgtm Indicates that a PR is ready to be merged.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants