minor race issue in mockResourceProvider

The interrupt tests for providers no longer check for the condition
during the diff operation. defer the lock so other test's DiffFns don't
need to be as carefull locking themselves.
This commit is contained in:
James Bardin 2017-12-20 09:18:38 -05:00
parent 80e3511c9d
commit cba592d54f
1 changed files with 2 additions and 2 deletions

View File

@ -196,13 +196,13 @@ func (p *MockResourceProvider) Diff(
info *InstanceInfo,
state *InstanceState,
desired *ResourceConfig) (*InstanceDiff, error) {
p.Lock()
defer p.Unlock()
p.DiffCalled = true
p.DiffInfo = info
p.DiffState = state
p.DiffDesired = desired
p.Unlock()
if p.DiffFn != nil {
return p.DiffFn(info, state, desired)