Skip to content
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

chore: Adds sleep in tests to avoid out of capacity errors #2674

Merged
merged 7 commits into from
Oct 10, 2024
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
2 changes: 1 addition & 1 deletion GNUmakefile
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ endif

ACCTEST_REGEX_RUN?=^TestAcc
ACCTEST_TIMEOUT?=300m
PARALLEL_GO_TEST?=20
PARALLEL_GO_TEST?=50
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

don't limit parallel tests


BINARY_NAME=terraform-provider-mongodbatlas
DESTINATION=./bin/$(BINARY_NAME)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ func TestMigAdvancedCluster_replicaSetAWSProviderUpdate(t *testing.T) {
)

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { mig.PreCheckBasic(t) },
PreCheck: mig.PreCheckBasicSleep(t),
CheckDestroy: acc.CheckDestroyCluster,
Steps: []resource.TestStep{
{
Expand Down Expand Up @@ -192,7 +192,7 @@ func TestMigAdvancedCluster_partialAdvancedConf(t *testing.T) {
)

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { acc.PreCheckBasic(t) },
PreCheck: mig.PreCheckBasicSleep(t),
CheckDestroy: acc.CheckDestroyCluster,
Steps: []resource.TestStep{
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func TestAccClusterAdvancedCluster_basicTenant(t *testing.T) {
clusterNameUpdated = acc.RandomClusterName()
)
resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { acc.PreCheckBasic(t) },
PreCheck: acc.PreCheckBasicSleep(t),
ProtoV6ProviderFactories: acc.TestAccProviderV6Factories,
CheckDestroy: acc.CheckDestroyCluster,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -64,7 +64,7 @@ func replicaSetAWSProviderTestCase(t *testing.T) resource.TestCase {
)

return resource.TestCase{
PreCheck: func() { acc.PreCheckBasic(t) },
PreCheck: acc.PreCheckBasicSleep(t),
ProtoV6ProviderFactories: acc.TestAccProviderV6Factories,
CheckDestroy: acc.CheckDestroyCluster,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -169,7 +169,7 @@ func TestAccClusterAdvancedCluster_unpausedToPaused(t *testing.T) {
)

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { acc.PreCheckBasic(t) },
PreCheck: acc.PreCheckBasicSleep(t),
ProtoV6ProviderFactories: acc.TestAccProviderV6Factories,
CheckDestroy: acc.CheckDestroyCluster,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -204,7 +204,7 @@ func TestAccClusterAdvancedCluster_pausedToUnpaused(t *testing.T) {
)

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { acc.PreCheckBasic(t) },
PreCheck: acc.PreCheckBasicSleep(t),
ProtoV6ProviderFactories: acc.TestAccProviderV6Factories,
CheckDestroy: acc.CheckDestroyCluster,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -266,7 +266,7 @@ func TestAccClusterAdvancedCluster_advancedConfig(t *testing.T) {
)

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { acc.PreCheckBasic(t) },
PreCheck: acc.PreCheckBasicSleep(t),
ProtoV6ProviderFactories: acc.TestAccProviderV6Factories,
CheckDestroy: acc.CheckDestroyCluster,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -301,7 +301,7 @@ func TestAccClusterAdvancedCluster_advancedConfig_MongoDBVersion5(t *testing.T)
)

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { acc.PreCheckBasic(t) },
PreCheck: acc.PreCheckBasicSleep(t),
ProtoV6ProviderFactories: acc.TestAccProviderV6Factories,
CheckDestroy: acc.CheckDestroyCluster,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -342,7 +342,7 @@ func TestAccClusterAdvancedCluster_defaultWrite(t *testing.T) {
)

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { acc.PreCheckBasic(t) },
PreCheck: acc.PreCheckBasicSleep(t),
ProtoV6ProviderFactories: acc.TestAccProviderV6Factories,
CheckDestroy: acc.CheckDestroyCluster,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -374,7 +374,7 @@ func TestAccClusterAdvancedClusterConfig_replicationSpecsAutoScaling(t *testing.
)

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { acc.PreCheckBasic(t) },
PreCheck: acc.PreCheckBasicSleep(t),
ProtoV6ProviderFactories: acc.TestAccProviderV6Factories,
CheckDestroy: acc.CheckDestroyCluster,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -417,7 +417,7 @@ func TestAccClusterAdvancedClusterConfig_replicationSpecsAnalyticsAutoScaling(t
)

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { acc.PreCheckBasic(t) },
PreCheck: acc.PreCheckBasicSleep(t),
ProtoV6ProviderFactories: acc.TestAccProviderV6Factories,
CheckDestroy: acc.CheckDestroyCluster,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -530,7 +530,7 @@ func TestAccClusterAdvancedClusterConfig_selfManagedShardingIncorrectType(t *tes
)

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { acc.PreCheckBasic(t) },
PreCheck: acc.PreCheckBasicSleep(t),
ProtoV6ProviderFactories: acc.TestAccProviderV6Factories,
CheckDestroy: acc.CheckDestroyCluster,
Steps: []resource.TestStep{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ func TestMigBackupRSCloudBackupSchedule_basic(t *testing.T) {
)

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { mig.PreCheckBasic(t) },
PreCheck: mig.PreCheckBasicSleep(t),
CheckDestroy: checkDestroy,
Steps: []resource.TestStep{
{
Expand Down Expand Up @@ -109,7 +109,7 @@ func TestMigBackupRSCloudBackupSchedule_copySettings(t *testing.T) {
checksUpdateWithZoneID := acc.AddAttrSetChecks(resourceName, checksCreate, "copy_settings.0.zone_id")

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { acc.PreCheckBasic(t) },
PreCheck: mig.PreCheckBasicSleep(t),
CheckDestroy: checkDestroy,
Steps: []resource.TestStep{
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func TestAccBackupRSCloudBackupSchedule_basic(t *testing.T) {
)

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { acc.PreCheckBasic(t) },
PreCheck: acc.PreCheckBasicSleep(t),
ProtoV6ProviderFactories: acc.TestAccProviderV6Factories,
CheckDestroy: checkDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -159,7 +159,7 @@ func TestAccBackupRSCloudBackupSchedule_export(t *testing.T) {
)

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { acc.PreCheckBasic(t) },
PreCheck: acc.PreCheckBasicSleep(t),
ExternalProviders: acc.ExternalProvidersOnlyAWS(),
ProtoV6ProviderFactories: acc.TestAccProviderV6Factories,

Expand Down Expand Up @@ -188,7 +188,7 @@ func TestAccBackupRSCloudBackupSchedule_onePolicy(t *testing.T) {
)

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { acc.PreCheckBasic(t) },
PreCheck: acc.PreCheckBasicSleep(t),
ProtoV6ProviderFactories: acc.TestAccProviderV6Factories,
CheckDestroy: checkDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -313,7 +313,7 @@ func TestAccBackupRSCloudBackupSchedule_copySettings_repSpecId(t *testing.T) {
checksUpdate := acc.AddAttrChecks(resourceName, checksDefaultRS, emptyCopySettingsChecks)

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { acc.PreCheckBasic(t) },
PreCheck: acc.PreCheckBasicSleep(t),
ProtoV6ProviderFactories: acc.TestAccProviderV6Factories,
CheckDestroy: checkDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -399,7 +399,7 @@ func TestAccBackupRSCloudBackupSchedule_copySettings_zoneId(t *testing.T) {
checksUpdate := acc.AddAttrChecks(resourceName, checksDefaultRS, emptyCopySettingsChecks)

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { acc.PreCheckBasic(t) },
PreCheck: acc.PreCheckBasicSleep(t),
ProtoV6ProviderFactories: acc.TestAccProviderV6Factories,
CheckDestroy: checkDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -429,7 +429,7 @@ func TestAccBackupRSCloudBackupScheduleImport_basic(t *testing.T) {
)

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { acc.PreCheckBasic(t) },
PreCheck: acc.PreCheckBasicSleep(t),
ProtoV6ProviderFactories: acc.TestAccProviderV6Factories,
CheckDestroy: checkDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -484,7 +484,7 @@ func TestAccBackupRSCloudBackupSchedule_azure(t *testing.T) {
)

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { acc.PreCheckBasic(t) },
PreCheck: acc.PreCheckBasicSleep(t),
ProtoV6ProviderFactories: acc.TestAccProviderV6Factories,
CheckDestroy: checkDestroy,
Steps: []resource.TestStep{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func TestMigBackupRSCloudBackupSnapshot_basic(t *testing.T) {
)

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { mig.PreCheckBasic(t) },
PreCheck: mig.PreCheckBasicSleep(t),
CheckDestroy: checkDestroy,
Steps: []resource.TestStep{
{
Expand Down Expand Up @@ -51,7 +51,7 @@ func TestMigBackupRSCloudBackupSnapshot_sharded(t *testing.T) {
)

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { acc.PreCheckBasic(t) },
PreCheck: mig.PreCheckBasicSleep(t),
CheckDestroy: checkDestroy,
Steps: []resource.TestStep{
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ func TestAccBackupRSCloudBackupSnapshot_basic(t *testing.T) {
)

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { acc.PreCheckBasic(t) },
PreCheck: acc.PreCheckBasicSleep(t),
ProtoV6ProviderFactories: acc.TestAccProviderV6Factories,
CheckDestroy: checkDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -75,7 +75,7 @@ func TestAccBackupRSCloudBackupSnapshot_sharded(t *testing.T) {
)

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { acc.PreCheckBasic(t) },
PreCheck: acc.PreCheckBasicSleep(t),
ProtoV6ProviderFactories: acc.TestAccProviderV6Factories,
CheckDestroy: checkDestroy,
Steps: []resource.TestStep{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func basicTestCase(tb testing.TB) *resource.TestCase {
checks = acc.AddAttrChecks(dataSourcePluralName, checks, attrsPluralDS)

return &resource.TestCase{
PreCheck: func() { acc.PreCheckBasic(tb) },
PreCheck: acc.PreCheckBasicSleep(tb),
ExternalProviders: acc.ExternalProvidersOnlyAWS(),
ProtoV6ProviderFactories: acc.TestAccProviderV6Factories,
Steps: []resource.TestStep{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ func TestAccCloudBackupSnapshotRestoreJob_basicDownload(t *testing.T) {
)

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { acc.PreCheckBasic(t) },
PreCheck: acc.PreCheckBasicSleep(t),
ProtoV6ProviderFactories: acc.TestAccProviderV6Factories,
CheckDestroy: checkDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -75,7 +75,7 @@ func basicTestCase(tb testing.TB) *resource.TestCase {
)

return &resource.TestCase{
PreCheck: func() { acc.PreCheckBasic(tb) },
PreCheck: acc.PreCheckBasicSleep(tb),
ProtoV6ProviderFactories: acc.TestAccProviderV6Factories,
CheckDestroy: checkDestroy,
Steps: []resource.TestStep{
Expand Down
18 changes: 9 additions & 9 deletions internal/service/cluster/resource_cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func basicTestCase(tb testing.TB) *resource.TestCase {
)

return &resource.TestCase{
PreCheck: func() { acc.PreCheckBasic(tb) },
PreCheck: acc.PreCheckBasicSleep(tb),
ProtoV6ProviderFactories: acc.TestAccProviderV6Factories,
CheckDestroy: acc.CheckDestroyCluster,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -101,7 +101,7 @@ func partialAdvancedConfTestCase(tb testing.TB) *resource.TestCase {
)

return &resource.TestCase{
PreCheck: func() { acc.PreCheckBasic(tb) },
PreCheck: acc.PreCheckBasicSleep(tb),
ProtoV6ProviderFactories: acc.TestAccProviderV6Factories,
CheckDestroy: acc.CheckDestroyCluster,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -163,7 +163,7 @@ func TestAccCluster_basic_DefaultWriteRead_AdvancedConf(t *testing.T) {
)

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { acc.PreCheckBasic(t) },
PreCheck: acc.PreCheckBasicSleep(t),
ProtoV6ProviderFactories: acc.TestAccProviderV6Factories,
CheckDestroy: acc.CheckDestroyCluster,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -222,7 +222,7 @@ func TestAccCluster_emptyAdvancedConf(t *testing.T) {
)

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { acc.PreCheckBasic(t) },
PreCheck: acc.PreCheckBasicSleep(t),
ProtoV6ProviderFactories: acc.TestAccProviderV6Factories,
CheckDestroy: acc.CheckDestroyCluster,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -264,7 +264,7 @@ func TestAccCluster_basicAdvancedConf(t *testing.T) {
)

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { acc.PreCheckBasic(t) },
PreCheck: acc.PreCheckBasicSleep(t),
ProtoV6ProviderFactories: acc.TestAccProviderV6Factories,
CheckDestroy: acc.CheckDestroyCluster,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -625,7 +625,7 @@ func TestAccCluster_AWSWithLabels(t *testing.T) {
)

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { acc.PreCheckBasic(t) },
PreCheck: acc.PreCheckBasicSleep(t),
ProtoV6ProviderFactories: acc.TestAccProviderV6Factories,
CheckDestroy: acc.CheckDestroyCluster,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -986,7 +986,7 @@ func TestAccCluster_withAutoScalingAWS(t *testing.T) {
)

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { acc.PreCheckBasic(t) },
PreCheck: acc.PreCheckBasicSleep(t),
ProtoV6ProviderFactories: acc.TestAccProviderV6Factories,
CheckDestroy: acc.CheckDestroyCluster,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -1267,7 +1267,7 @@ func TestAccCluster_basicAWS_UnpauseToPaused(t *testing.T) {
)

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { acc.PreCheckBasic(t) },
PreCheck: acc.PreCheckBasicSleep(t),
ProtoV6ProviderFactories: acc.TestAccProviderV6Factories,
CheckDestroy: acc.CheckDestroyCluster,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -1315,7 +1315,7 @@ func TestAccCluster_basicAWS_PausedToUnpaused(t *testing.T) {
)

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { acc.PreCheckBasic(t) },
PreCheck: acc.PreCheckBasicSleep(t),
ProtoV6ProviderFactories: acc.TestAccProviderV6Factories,
CheckDestroy: acc.CheckDestroyCluster,
Steps: []resource.TestStep{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ func singleRegionTestCase(t *testing.T) *resource.TestCase {
clusterName = clusterInfo.Name
)
return &resource.TestCase{
PreCheck: func() { acc.PreCheckBasic(t) },
PreCheck: acc.PreCheckBasicSleep(t),
ProtoV6ProviderFactories: acc.TestAccProviderV6Factories,
CheckDestroy: checkDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -80,7 +80,7 @@ func multiRegionTestCase(t *testing.T) *resource.TestCase {
)

return &resource.TestCase{
PreCheck: func() { acc.PreCheckBasic(t) },
PreCheck: acc.PreCheckBasicSleep(t),
ProtoV6ProviderFactories: acc.TestAccProviderV6Factories,
CheckDestroy: checkDestroy,
Steps: []resource.TestStep{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ func TestAccFederatedDatabaseInstance_atlasCluster(t *testing.T) {
)

resource.ParallelTest(t, resource.TestCase{
PreCheck: func() { acc.PreCheckBasic(t) },
PreCheck: acc.PreCheckBasicSleep(t),
CheckDestroy: acc.CheckDestroyFederatedDatabaseInstance,
Steps: []resource.TestStep{
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func basicTestCase(tb testing.TB, checkZoneID, withBackup bool) *resource.TestCa
}

return &resource.TestCase{
PreCheck: func() { acc.PreCheckBasic(tb) },
PreCheck: acc.PreCheckBasicSleep(tb),
ProtoV6ProviderFactories: acc.TestAccProviderV6Factories,
CheckDestroy: checkDestroy,
Steps: []resource.TestStep{
Expand Down Expand Up @@ -113,7 +113,7 @@ func TestAccGlobalClusterConfig_database(t *testing.T) {
)

resource.Test(t, resource.TestCase{
PreCheck: func() { acc.PreCheckBasic(t) },
PreCheck: acc.PreCheckBasicSleep(t),
ProtoV6ProviderFactories: acc.TestAccProviderV6Factories,
CheckDestroy: checkDestroy,
Steps: []resource.TestStep{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ func TestAccLDAPConfiguration_withVerify_CACertificateComplete(t *testing.T) {
)

resource.Test(t, resource.TestCase{
PreCheck: func() { acc.PreCheckLDAPCert(t) },
PreCheck: func() { acc.PreCheckLDAPCert(t); acc.SerialSleep(t) },
ProtoV6ProviderFactories: acc.TestAccProviderV6Factories,
Steps: []resource.TestStep{
{
Expand Down
Loading