From add2dd8c2db66ceaf89b4a4c4a07239b183e17d4 Mon Sep 17 00:00:00 2001 From: Michael Schurter Date: Wed, 19 Dec 2018 15:42:49 -0800 Subject: [PATCH] test: copy AR's Alloc before mutating Fixes a race in client tests --- client/gc_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/gc_test.go b/client/gc_test.go index b40030368..101b91c47 100644 --- a/client/gc_test.go +++ b/client/gc_test.go @@ -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) }