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

[ORCA-4601] Add support for Event Orchestration Cache Variables #822

Prev Previous commit
Next Next commit
Remove unneeded sleep calls and rename orch/service resources
  • Loading branch information
c-kaieong committed Apr 3, 2024
commit 24b7ea3c4e9ccf9d87dce352bb8088034636bbb7
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
)

func TestAccDataSourcePagerDutyEventOrchestrationGlobalCacheVariable_Basic(t *testing.T) {
on := fmt.Sprintf("tf_orchestration_%s", acctest.RandString(5))
on := fmt.Sprintf("tf-orchestration-%s", acctest.RandString(5))
name := fmt.Sprintf("tf_global_cache_variable_%s", acctest.RandString(5))
irn := "pagerduty_event_orchestration_global_cache_variable.orch_cv"
n := "data.pagerduty_event_orchestration_global_cache_variable.by_id"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
)

func TestAccDataSourcePagerDutyEventOrchestrationServiceCacheVariable_Basic(t *testing.T) {
on := fmt.Sprintf("tf_orchestration_%s", acctest.RandString(5))
on := fmt.Sprintf("tf-orchestration-%s", acctest.RandString(5))
name := fmt.Sprintf("tf_service_cache_variable_%s", acctest.RandString(5))
irn := "pagerduty_event_orchestration_service_cache_variable.orch_cv"
n := "data.pagerduty_event_orchestration_service_cache_variable.by_id"
Expand Down
4 changes: 0 additions & 4 deletions pagerduty/event_orchestration_cache_variable_util.go
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,6 @@ func resourceEventOrchestrationCacheVariableCreate(ctx context.Context, d *schem
})

if retryErr != nil {
time.Sleep(2 * time.Second)
return diag.FromErr(retryErr)
}

Expand Down Expand Up @@ -364,7 +363,6 @@ func resourceEventOrchestrationCacheVariableDelete(ctx context.Context, d *schem
})

if retryErr != nil {
time.Sleep(2 * time.Second)
return diag.FromErr(retryErr)
}

Expand Down Expand Up @@ -422,7 +420,6 @@ func getEventOrchestrationCacheVariableById(ctx context.Context, d *schema.Resou
return retry.NonRetryableError(err)
}

time.Sleep(30 * time.Second)
return retry.RetryableError(err)
} else if cacheVariable != nil {
d.SetId(cacheVariable.ID)
Expand Down Expand Up @@ -457,7 +454,6 @@ func getEventOrchestrationCacheVariableByName(ctx context.Context, d *schema.Res
return retry.NonRetryableError(err)
}

time.Sleep(30 * time.Second)
return retry.RetryableError(err)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func init() {
}

func TestAccPagerDutyEventOrchestrationGlobalCacheVariable_Basic(t *testing.T) {
orch := fmt.Sprintf("tf_orchestration_%s", acctest.RandString(5))
orch := fmt.Sprintf("tf-orchestration-%s", acctest.RandString(5))
cv := "pagerduty_event_orchestration_global_cache_variable.cv_1"

name1 := fmt.Sprintf("tf_global_cache_variable_%s", acctest.RandString(5))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ import (
func init() {
resource.AddTestSweepers("pagerduty_event_orchestration_service_cache_variable", &resource.Sweeper{
Name: "pagerduty_event_orchestration_service_cache_variable",
F: testSweepEventOrchestration,
F: testSweepService,
})
}

func TestAccPagerDutyEventOrchestrationServiceCacheVariable_Basic(t *testing.T) {
svc := fmt.Sprintf("tf_service_%s", acctest.RandString(5))
svc := fmt.Sprintf("tf-service-%s", acctest.RandString(5))
cv := "pagerduty_event_orchestration_service_cache_variable.cv_1"

name1 := fmt.Sprintf("tf_service_cache_variable_%s", acctest.RandString(5))
Expand Down