Skip to content

Commit

Permalink
fix from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
smalltown committed Mar 28, 2019
1 parent b1a3056 commit f9c1a99
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions test/elastikube_cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ import (
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"
)

const (
MaxRetries = 30
TimeBetweenRetries = 5 * time.Second
)

func TestElastikubeCluster(t *testing.T) {

t.Parallel()
Expand Down Expand Up @@ -155,8 +160,6 @@ func testBastionHost(t *testing.T, terraformOptions *terraform.Options, keyPair
}

// It can take a minute or so for the Instance to boot up, so retry a few times
maxRetries := 30
timeBetweenRetries := 5 * time.Second
description := fmt.Sprintf("SSH with Agent to bastion host %s", bastionPublicIP)

// Run a simple echo command on the server
Expand All @@ -183,8 +186,6 @@ func testBastionHost(t *testing.T, terraformOptions *terraform.Options, keyPair
func testKubernetes(t *testing.T, kubectlOptions *k8s.KubectlOptions, exampleFolder string) {

// It can take several minutes for the Kubernetes cluster to boot up, so retry a few times
maxRetries := 30
timeBetweenRetries := 30 * time.Second
description := fmt.Sprint("Access Kubernetes cluster")

// Verify that we can access Kubernetes cluster by kubectl
Expand Down Expand Up @@ -248,8 +249,8 @@ func testKubernetes(t *testing.T, kubectlOptions *k8s.KubectlOptions, exampleFol
http_helper.HttpGetWithRetryWithCustomValidation(
t,
fmt.Sprintf("http://%s", kubeTunnel.Endpoint()),
30,
10*time.Second,
MaxRetries,
TimeBetweenRetries,
func(statusCode int, body string) bool {
return statusCode == 200
},
Expand Down

0 comments on commit f9c1a99

Please sign in to comment.