Prevent race between alloc runners

Block ar1's periodic syncing which could recreate the state file ar2 was
destroying.
This commit is contained in:
Michael Schurter 2017-01-17 13:10:20 -08:00
parent 15952e5d17
commit ea87091e58

View file

@ -405,6 +405,10 @@ func TestAllocRunner_SaveRestoreState_TerminalAlloc(t *testing.T) {
t.Fatalf("err: %v", err)
}
// Ensure ar1 doesn't recreate the state file
ar.persistLock.Lock()
defer ar.persistLock.Unlock()
// Ensure both alloc runners don't destroy
ar.destroy = true