Skip to content

Fix timeout in acctest #602

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

Merged
merged 3 commits into from
Nov 12, 2021
Merged
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions .github/workflows/automated-test-acceptances.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,5 @@ jobs:
GCP_KEY_VERSION_RESOURCE_ID: ${{ secrets.GCP_KEY_VERSION_RESOURCE_ID }}
CA_CERT: ${{ secrets.CA_CERT }}
MONGODB_ATLAS_ENABLE_BETA: ${{ secrets.MONGODB_ATLAS_ENABLE_BETA }}
ACCTEST_TIMEOUT: ${{ secrets.ACCTEST_TIMEOUT }}
run: make testacc
3 changes: 2 additions & 1 deletion GNUmakefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
TEST?=$$(go list ./... | grep -v /integrationtesting)
ACCTEST_TIMEOUT?=300m
GOFMT_FILES?=$$(find . -name '*.go' |grep -v vendor)
PKG_NAME=mongodbatlas

Expand Down Expand Up @@ -36,7 +37,7 @@ test: fmtcheck
.PHONY: testacc
testacc: fmtcheck
@$(eval VERSION=acc)
TF_ACC=1 go test $(TEST) -v -parallel 20 $(TESTARGS) -timeout 300m -cover -ldflags="$(LINKER_FLAGS)"
TF_ACC=1 go test $(TEST) -v -parallel 20 $(TESTARGS) -timeout $(ACCTEST_TIMEOUT) -cover -ldflags="$(LINKER_FLAGS)"

.PHONY: fmt
fmt:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import (
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"

matlas "go.mongodb.org/atlas/mongodbatlas"
)

Expand Down
6 changes: 3 additions & 3 deletions mongodbatlas/resource_mongodbatlas_serverless_instance.go
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ func resourceMongoDBAtlasServerlessInstanceDelete(ctx context.Context, d *schema
return diag.FromErr(fmt.Errorf("error deleting MongoDB Serverless Instance (%s): %s", serverlessName, err))
}

log.Println("[INFO] Waiting for MongoDB Cluster to be destroyed")
log.Println("[INFO] Waiting for MongoDB Serverless Instance to be destroyed")

stateConf := &resource.StateChangeConf{
Pending: []string{"IDLE", "CREATING", "UPDATING", "REPAIRING", "DELETING"},
Expand Down Expand Up @@ -176,7 +176,7 @@ func resourceMongoDBAtlasServerlessInstanceRead(ctx context.Context, d *schema.R
return nil
}

return diag.Errorf("error getting search index information: %s", err)
return diag.Errorf("error getting serverless instance information: %s", err)
}

if err := d.Set("id", serverlessInstance.ID); err != nil {
Expand Down Expand Up @@ -253,7 +253,7 @@ func resourceMongoDBAtlasServerlessInstanceCreate(ctx context.Context, d *schema
// Wait, catching any errors
_, err = stateConf.WaitForStateContext(ctx)
if err != nil {
return diag.FromErr(fmt.Errorf(errorClusterCreate, err))
return diag.Errorf("error creating MongoDB Serverless Instance: %s", err)
}

d.SetId(encodeStateID(map[string]string{
Expand Down