From 284725fa942221a3510ea88aec6a9fc7807f57ce Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Tue, 16 Aug 2016 09:26:33 -0700 Subject: [PATCH] providers/azurerm: timeout storage account for an hour --- builtin/providers/azurerm/resource_arm_storage_account.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/builtin/providers/azurerm/resource_arm_storage_account.go b/builtin/providers/azurerm/resource_arm_storage_account.go index 522af7591..cbeb1a528 100644 --- a/builtin/providers/azurerm/resource_arm_storage_account.go +++ b/builtin/providers/azurerm/resource_arm_storage_account.go @@ -143,6 +143,10 @@ func resourceArmStorageAccountCreate(d *schema.ResourceData, meta interface{}) e // since we will likely also want to introduce a time-based timeout. var createErr error select { + case <-time.After(1 * time.Hour): + // An hour is way above the expected P99 for this API call so + // we premature cancel and error here. + createErr = wrap.Cancel() case createErr = <-wrap.ErrCh: // Successfully ran (but perhaps not successfully completed) // the function.