test: copy AR's Alloc before mutating

Fixes a race in client tests
This commit is contained in:
Michael Schurter 2018-12-19 15:42:49 -08:00
parent 17ed3f27ae
commit add2dd8c2d
1 changed files with 1 additions and 1 deletions

View File

@ -30,7 +30,7 @@ func gcConfig() *GCConfig {
// runners to be terminal
func exitAllocRunner(runners ...AllocRunner) {
for _, ar := range runners {
terminalAlloc := ar.Alloc()
terminalAlloc := ar.Alloc().Copy()
terminalAlloc.DesiredStatus = structs.AllocDesiredStatusStop
ar.Update(terminalAlloc)
}