From 259547bb10664073eec8110a373d22bb73e58e41 Mon Sep 17 00:00:00 2001 From: Pierce Lopez Date: Fri, 26 May 2017 02:03:44 -0400 Subject: [PATCH] nsqadmin tests: each nsqlookupd needs its own options struct to avoid data races setting opts.logLevel --- nsqadmin/http_test.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/nsqadmin/http_test.go b/nsqadmin/http_test.go index 9e7fd0c8a..d5389bd0c 100644 --- a/nsqadmin/http_test.go +++ b/nsqadmin/http_test.go @@ -529,9 +529,12 @@ func TestHTTPconfig(t *testing.T) { lopts := nsqlookupd.NewOptions() lopts.Logger = test.NewTestLogger(t) - _, _, lookupd1 := mustStartNSQLookupd(lopts) + + lopts1 := *lopts + _, _, lookupd1 := mustStartNSQLookupd(&lopts1) defer lookupd1.Exit() - _, _, lookupd2 := mustStartNSQLookupd(lopts) + lopts2 := *lopts + _, _, lookupd2 := mustStartNSQLookupd(&lopts2) defer lookupd2.Exit() url := fmt.Sprintf("http://%s/config/nsqlookupd_http_addresses", nsqadmin1.RealHTTPAddr())