test: copy AR's Alloc before mutating
Fixes a race in client tests
This commit is contained in:
parent
17ed3f27ae
commit
add2dd8c2d
|
@ -30,7 +30,7 @@ func gcConfig() *GCConfig {
|
||||||
// runners to be terminal
|
// runners to be terminal
|
||||||
func exitAllocRunner(runners ...AllocRunner) {
|
func exitAllocRunner(runners ...AllocRunner) {
|
||||||
for _, ar := range runners {
|
for _, ar := range runners {
|
||||||
terminalAlloc := ar.Alloc()
|
terminalAlloc := ar.Alloc().Copy()
|
||||||
terminalAlloc.DesiredStatus = structs.AllocDesiredStatusStop
|
terminalAlloc.DesiredStatus = structs.AllocDesiredStatusStop
|
||||||
ar.Update(terminalAlloc)
|
ar.Update(terminalAlloc)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue