Skip to content

Commit

Permalink
Race condition things
Browse files Browse the repository at this point in the history
  • Loading branch information
cwood committed Mar 30, 2017
1 parent 00cb79e commit cc78f0b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion builtin/providers/aws/data_source_aws_subnet_ids_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package aws
import (
"fmt"
"testing"
"time"

"github.com/hashicorp/terraform/helper/resource"
"github.com/hashicorp/terraform/terraform"
Expand All @@ -16,6 +17,11 @@ func TestAccDataSourceAwsSubnetIDs(t *testing.T) {
resource.TestStep{
Config: testAccDataSourceAwsSubnetIDsConfig,
Check: resource.ComposeTestCheckFunc(
func(*terraform.State) error {
fmt.Printf("Sleeping due to race condition")
time.Sleep(10 * time.Second)
return nil
},
testAccDataSourceAwsSubnetIDsCheck("data.aws_subnet_ids.selected"),
),
},
Expand Down Expand Up @@ -45,7 +51,6 @@ func testAccDataSourceAwsSubnetIDsCheck(name string) resource.TestCheckFunc {
return fmt.Errorf("ID of this resource should be the vpc id")
}

fmt.Printf("%v", rs)
if len(attr["ids"]) != 1 {
return fmt.Errorf("Should have at least one subnet")
}
Expand Down

0 comments on commit cc78f0b

Please sign in to comment.