mirror of
https://github.com/opentofu/opentofu.git
synced 2025-02-25 18:45:20 -06:00
make the mock provider stoppable
The mock provider couldn't be stopped during diff, because the single mutex was held through the oepration. Release the mutex so Stop can be called.
This commit is contained in:
@@ -196,13 +196,14 @@ func (p *MockResourceProvider) Diff(
|
||||
info *InstanceInfo,
|
||||
state *InstanceState,
|
||||
desired *ResourceConfig) (*InstanceDiff, error) {
|
||||
p.Lock()
|
||||
defer p.Unlock()
|
||||
|
||||
p.Lock()
|
||||
p.DiffCalled = true
|
||||
p.DiffInfo = info
|
||||
p.DiffState = state
|
||||
p.DiffDesired = desired
|
||||
p.Unlock()
|
||||
|
||||
if p.DiffFn != nil {
|
||||
return p.DiffFn(info, state, desired)
|
||||
}
|
||||
|
Reference in New Issue
Block a user