From 343b96c9d72f8c63d4632a19ed88bb9ba0fa74f0 Mon Sep 17 00:00:00 2001 From: James Bardin Date: Tue, 7 Mar 2017 11:34:07 -0500 Subject: [PATCH] Add MetaReset Make sure the ArmClient gets a new StopContext for each test --- builtin/providers/azurerm/provider.go | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/builtin/providers/azurerm/provider.go b/builtin/providers/azurerm/provider.go index 58d0b6a8f..8364fe4cf 100644 --- a/builtin/providers/azurerm/provider.go +++ b/builtin/providers/azurerm/provider.go @@ -194,6 +194,12 @@ func providerConfigure(p *schema.Provider) schema.ConfigureFunc { client.StopContext = p.StopContext() + // replaces the context between tests + p.MetaReset = func() error { + client.StopContext = p.StopContext() + return nil + } + // List all the available providers and their registration state to avoid unnecessary // requests. This also lets us check if the provider credentials are correct. providerList, err := client.providers.List(nil, "")