fix race in MockResourceProvider

Input can be called concurrently from multiple nodes in the graph.
This commit is contained in:
James Bardin 2017-08-16 15:19:17 -04:00
parent 08339b004b
commit db6ef69e5b
1 changed files with 2 additions and 0 deletions

View File

@ -94,6 +94,8 @@ func (p *MockResourceProvider) Close() error {
func (p *MockResourceProvider) Input( func (p *MockResourceProvider) Input(
input UIInput, c *ResourceConfig) (*ResourceConfig, error) { input UIInput, c *ResourceConfig) (*ResourceConfig, error) {
p.Lock()
defer p.Unlock()
p.InputCalled = true p.InputCalled = true
p.InputInput = input p.InputInput = input
p.InputConfig = c p.InputConfig = c