Skip to content

Commit 305df75

Browse files
committed
Fix timeout in acctest (#602)
* fix timeout in serverless and private endpoint * change timeout in testacc * added default timeout
1 parent 5e1f9ab commit 305df75

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

.github/workflows/automated-test-acceptances.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,4 +79,5 @@ jobs:
7979
GCP_KEY_VERSION_RESOURCE_ID: ${{ secrets.GCP_KEY_VERSION_RESOURCE_ID }}
8080
CA_CERT: ${{ secrets.CA_CERT }}
8181
MONGODB_ATLAS_ENABLE_BETA: ${{ secrets.MONGODB_ATLAS_ENABLE_BETA }}
82+
ACCTEST_TIMEOUT: ${{ secrets.ACCTEST_TIMEOUT }}
8283
run: make testacc

GNUmakefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
TEST?=$$(go list ./... | grep -v /integrationtesting)
2+
ACCTEST_TIMEOUT?=300m
23
GOFMT_FILES?=$$(find . -name '*.go' |grep -v vendor)
34
PKG_NAME=mongodbatlas
45

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

4142
.PHONY: fmt
4243
fmt:

mongodbatlas/resource_mongodbatlas_privatelink_endpoint.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ import (
1313
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/resource"
1414
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/schema"
1515
"github.com/hashicorp/terraform-plugin-sdk/v2/helper/validation"
16-
1716
matlas "go.mongodb.org/atlas/mongodbatlas"
1817
)
1918

mongodbatlas/resource_mongodbatlas_serverless_instance.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ func resourceMongoDBAtlasServerlessInstanceDelete(ctx context.Context, d *schema
138138
return diag.FromErr(fmt.Errorf("error deleting MongoDB Serverless Instance (%s): %s", serverlessName, err))
139139
}
140140

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

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

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

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

259259
d.SetId(encodeStateID(map[string]string{

0 commit comments

Comments
 (0)