Skip to content
This repository has been archived by the owner on Jun 29, 2022. It is now read-only.

Commit

Permalink
Merge pull request #761 from kinvolk/invidian/ingress-e2e-tests-timeo…
Browse files Browse the repository at this point in the history
…ut-fix

test/ingress/aws: fix tests timeouts and run tests in parallel
  • Loading branch information
invidian authored Aug 5, 2020
2 parents a8798ae + a32de33 commit bc8403c
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 4 deletions.
4 changes: 2 additions & 2 deletions ci/aws/aws-cluster.lokocfg.envsubst
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ EOF
oidc {}
}

component "metrics-server" {}

component "openebs-operator" {}

# openebs-storage-class component should always be the last to be installed
Expand Down Expand Up @@ -98,8 +100,6 @@ component "contour" {
service_type = "NodePort"
}

component "metrics-server" {}

component "cert-manager" {
email = "$EMAIL"
service_monitor = true
Expand Down
4 changes: 2 additions & 2 deletions ci/packet/packet-cluster.lokocfg.envsubst
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ EOF
oidc {}
}

component "metrics-server" {}

component "openebs-operator" {}

# openebs-storage-class component should always be the last to be installed
Expand Down Expand Up @@ -93,8 +95,6 @@ component "metallb" {
service_monitor = true
}

component "metrics-server" {}

component "cert-manager" {
email = "$EMAIL"
service_monitor = true
Expand Down
12 changes: 12 additions & 0 deletions pkg/components/metrics-server/component.go
Original file line number Diff line number Diff line change
Expand Up @@ -93,5 +93,17 @@ func (c *component) Metadata() components.Metadata {
return components.Metadata{
Name: name,
Namespace: c.Namespace,
Helm: components.HelmMetadata{
// metrics-server provides Kubernetes API Resource, so when it is unavailable, it may
// cause Kubernetes clients to fail creating the client objects, as the client discovery
// will be returning the following error:
//
// failed to create Kubernetes client: unable to retrieve the complete list of server APIs:
// metrics.k8s.io/v1beta1: the server is currently unable to handle the request
//
// Adding wait will ensure, that metrics API is available before proceeding with installation
// of other components.
Wait: true,
},
}
}
4 changes: 4 additions & 0 deletions test/ingress/aws/aws_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ import (
const (
retryIntervalSeconds = 5
maxRetries = 60
httpTimeout = 4 * time.Second
)

func TestAWSIngress(t *testing.T) {
Expand All @@ -57,6 +58,8 @@ func TestAWSIngress(t *testing.T) {
for _, tc := range testCases {
tc := tc
t.Run(tc.Ingress, func(t *testing.T) {
t.Parallel()

client := testutil.CreateKubeClient(t)

i, err := client.NetworkingV1beta1().Ingresses("httpbin").Get(context.TODO(), "httpbin", metav1.GetOptions{})
Expand Down Expand Up @@ -134,6 +137,7 @@ idWw1VrejtwclobqNMVtG3EiPUIpJGpbMcJgbiLSmKkrvQtGng==
}

return &http.Client{
Timeout: httpTimeout,
Transport: &http.Transport{
TLSClientConfig: &tls.Config{
RootCAs: rootCAs,
Expand Down

0 comments on commit bc8403c

Please sign in to comment.