Skip to content

Commit

Permalink
add delete timeout test
Browse files Browse the repository at this point in the history
The timeout value is still not being persisted.

While it doesn't fix this issue, make sure to always return Private
during Plan.
  • Loading branch information
jbardin committed Jun 5, 2019
1 parent ffde484 commit 32a627e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
21 changes: 21 additions & 0 deletions builtin/providers/test/resource_timeout_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,27 @@ resource "test_resource_timeout" "foo" {
},
})
}

func TestResourceTimeout_delete(t *testing.T) {
// If the delete timeout isn't saved until destroy, the cleanup here will
// fail because the default is only 20m.
resource.UnitTest(t, resource.TestCase{
Providers: testAccProviders,
CheckDestroy: testAccCheckResourceDestroy,
Steps: []resource.TestStep{
resource.TestStep{
Config: strings.TrimSpace(`
resource "test_resource_timeout" "foo" {
delete_delay = "25m"
timeouts {
delete = "30m"
}
}
`),
},
},
})
}
func TestResourceTimeout_update(t *testing.T) {
resource.UnitTest(t, resource.TestCase{
Providers: testAccProviders,
Expand Down
1 change: 1 addition & 0 deletions helper/plugin/grpc_provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -574,6 +574,7 @@ func (s *GRPCProviderServer) PlanResourceChange(_ context.Context, req *proto.Pl
// We don't usually plan destroys, but this can return early in any case.
if proposedNewStateVal.IsNull() {
resp.PlannedState = req.ProposedNewState
resp.PlannedPrivate = req.PriorPrivate
return resp, nil
}

Expand Down

0 comments on commit 32a627e

Please sign in to comment.