diff --git a/aws/resource_aws_glue_workflow_test.go b/aws/resource_aws_glue_workflow_test.go index bbde3eae45e..f33d211ae71 100644 --- a/aws/resource_aws_glue_workflow_test.go +++ b/aws/resource_aws_glue_workflow_test.go @@ -26,11 +26,10 @@ func testSweepGlueWorkflow(region string) error { } conn := client.(*AWSClient).glueconn - listWorkflowInput := &glue.ListWorkflowsInput{} - - listOutput, err := conn.ListWorkflows(listWorkflowInput) + listOutput, err := conn.ListWorkflows(&glue.ListWorkflowsInput{}) if err != nil { - if testSweepSkipSweepError(err) { + // Some endpoints that do not support Glue Workflows return InternalFailure + if testSweepSkipSweepError(err) || isAWSErr(err, "InternalFailure", "") { log.Printf("[WARN] Skipping Glue Workflow sweep for %s: %s", region, err) return nil } @@ -52,7 +51,7 @@ func TestAccAWSGlueWorkflow_Basic(t *testing.T) { resourceName := "aws_glue_workflow.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSGlueWorkflow(t) }, Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueWorkflowDestroy, Steps: []resource.TestStep{ @@ -79,7 +78,7 @@ func TestAccAWSGlueWorkflow_DefaultRunProperties(t *testing.T) { resourceName := "aws_glue_workflow.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSGlueWorkflow(t) }, Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueWorkflowDestroy, Steps: []resource.TestStep{ @@ -108,7 +107,7 @@ func TestAccAWSGlueWorkflow_Description(t *testing.T) { resourceName := "aws_glue_workflow.test" resource.ParallelTest(t, resource.TestCase{ - PreCheck: func() { testAccPreCheck(t) }, + PreCheck: func() { testAccPreCheck(t); testAccPreCheckAWSGlueWorkflow(t) }, Providers: testAccProviders, CheckDestroy: testAccCheckAWSGlueWorkflowDestroy, Steps: []resource.TestStep{ @@ -135,6 +134,21 @@ func TestAccAWSGlueWorkflow_Description(t *testing.T) { }) } +func testAccPreCheckAWSGlueWorkflow(t *testing.T) { + conn := testAccProvider.Meta().(*AWSClient).glueconn + + _, err := conn.ListWorkflows(&glue.ListWorkflowsInput{}) + + // Some endpoints that do not support Glue Workflows return InternalFailure + if testAccPreCheckSkipError(err) || isAWSErr(err, "InternalFailure", "") { + t.Skipf("skipping acceptance testing: %s", err) + } + + if err != nil { + t.Fatalf("unexpected PreCheck error: %s", err) + } +} + func testAccCheckAWSGlueWorkflowExists(resourceName string, workflow *glue.Workflow) resource.TestCheckFunc { return func(s *terraform.State) error { rs, ok := s.RootModule().Resources[resourceName]