From bbd01313aec4fca6c3d3e11f701ac57a9df0c7ea Mon Sep 17 00:00:00 2001 From: Vincent Robbemond Date: Mon, 5 Mar 2018 03:15:11 +0100 Subject: [PATCH] Fix possible data race in manager/state/store/memory_test.go Signed-off-by: Vincent Robbemond (cherry picked from commit 06add13d57411618c18d4b9d181013e932462834) Signed-off-by: Sebastiaan van Stijn --- manager/state/store/memory_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/manager/state/store/memory_test.go b/manager/state/store/memory_test.go index b4df214b0f..cd7740e734 100644 --- a/manager/state/store/memory_test.go +++ b/manager/state/store/memory_test.go @@ -2035,7 +2035,7 @@ func BenchmarkNodeConcurrency(b *testing.B) { var wg sync.WaitGroup for c := 0; c != 5; c++ { wg.Add(1) - go func() { + go func(c int) { defer wg.Done() for i := 0; i < b.N; i++ { _ = s.Update(func(tx1 Tx) error { @@ -2050,7 +2050,7 @@ func BenchmarkNodeConcurrency(b *testing.B) { return nil }) } - }() + }(c) } for c := 0; c != 5; c++ {