Skip to content

Commit

Permalink
fix lint-consul-retry
Browse files Browse the repository at this point in the history
  • Loading branch information
absolutelightning committed Feb 14, 2024
1 parent f4ec771 commit f494b6d
Showing 1 changed file with 10 additions and 8 deletions.
18 changes: 10 additions & 8 deletions test/acceptance/tests/basic_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ import (
"github.com/gruntwork-io/terratest/modules/terraform"
"github.com/hashicorp/consul/api"
"github.com/hashicorp/consul/sdk/testutil/retry"
"github.com/stretchr/testify/require"

"github.com/hashicorp/terraform-aws-consul-lambda/test/acceptance/framework/config"
"github.com/hashicorp/terraform-aws-consul-lambda/test/acceptance/framework/logger"
"github.com/stretchr/testify/require"
)

type SetupConfig struct {
Expand Down Expand Up @@ -117,8 +118,9 @@ func TestBasic(t *testing.T) {
lambdaToMeshServiceName := fmt.Sprintf("lambda_to_mesh_example_%s", suffix)

var consulServerTaskARN string
testingT := t
retry.RunWith(&retry.Timer{Timeout: 3 * time.Minute, Wait: 10 * time.Second}, t, func(r *retry.R) {
taskListOut, err := shell.RunCommandAndGetOutputE(t, shell.Command{
taskListOut, err := shell.RunCommandAndGetOutputE(testingT, shell.Command{
Command: "aws",
Args: []string{
"ecs",
Expand Down Expand Up @@ -152,7 +154,7 @@ func TestBasic(t *testing.T) {
retry.RunWith(&retry.Timer{Timeout: 5 * time.Minute, Wait: 10 * time.Second}, t, func(r *retry.R) {
var services []api.CatalogService
err := ExecuteRemoteCommandJSON(
t,
testingT,
suite.Config(),
consulServerTaskARN,
"consul-server",
Expand Down Expand Up @@ -280,7 +282,7 @@ func TestBasic(t *testing.T) {
qs = ""
}
err := ExecuteRemoteCommandJSON(
t,
testingT,
suite.Config(),
consulServerTaskARN,
"consul-server",
Expand All @@ -296,7 +298,7 @@ func TestBasic(t *testing.T) {
// Create an intention to allow the Lambda function to call the test_client service
retry.RunWith(&retry.Timer{Timeout: 60 * time.Second, Wait: 5 * time.Second}, t, func(r *retry.R) {
result, err := ExecuteRemoteCommand(
t,
testingT,
suite.Config(),
consulServerTaskARN,
"consul-server",
Expand All @@ -313,7 +315,7 @@ func TestBasic(t *testing.T) {
// Export the test_client service so it can be called by the Lambda function.
retry.RunWith(&retry.Timer{Timeout: 60 * time.Second, Wait: 5 * time.Second}, t, func(r *retry.R) {
result, err := ExecuteRemoteCommand(
t,
testingT,
suite.Config(),
consulServerTaskARN,
"consul-server",
Expand All @@ -335,7 +337,7 @@ func TestBasic(t *testing.T) {
defer os.Remove(outFile.Name())

retry.RunWith(&retry.Timer{Timeout: 120 * time.Second, Wait: 5 * time.Second}, t, func(r *retry.R) {
_, err := shell.RunCommandAndGetOutputE(t, shell.Command{
_, err := shell.RunCommandAndGetOutputE(testingT, shell.Command{
Command: "aws",
Args: []string{
"lambda",
Expand Down Expand Up @@ -382,7 +384,7 @@ func TestBasic(t *testing.T) {
retry.RunWith(&retry.Timer{Timeout: 60 * time.Second, Wait: 5 * time.Second}, t, func(r *retry.R) {
var services []api.CatalogService
err := ExecuteRemoteCommandJSON(
t,
testingT,
suite.Config(),
consulServerTaskARN,
"consul-server",
Expand Down

0 comments on commit f494b6d

Please sign in to comment.