From 54eb9343b93bd5d825eaad6c597d42a795bf4e6a Mon Sep 17 00:00:00 2001 From: Samuel Attwood Date: Thu, 13 Jun 2024 08:42:01 -0400 Subject: [PATCH] Fix test --- surveyor/conn_pool_test.go | 10 +++++----- surveyor/surveyor.go | 3 +-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/surveyor/conn_pool_test.go b/surveyor/conn_pool_test.go index ffb8d77..7eea54c 100644 --- a/surveyor/conn_pool_test.go +++ b/surveyor/conn_pool_test.go @@ -52,15 +52,15 @@ func TestConnPool(t *testing.T) { wg := &sync.WaitGroup{} wg.Add(3) go func() { - c1, c1e = cp.Get(o1) + c1, c1e = cp.Get(append(natsDefaults, append(natsOptions, o1...)...)) wg.Done() }() go func() { - c2, c2e = cp.Get(o2) + c2, c2e = cp.Get(append(natsDefaults, append(natsOptions, o2...)...)) wg.Done() }() go func() { - c3, c3e = cp.Get(o3) + c3, c3e = cp.Get(append(natsDefaults, append(natsOptions, o3...)...)) wg.Done() }() wg.Wait() @@ -81,7 +81,7 @@ func TestConnPool(t *testing.T) { assert.False(c2.nc.IsClosed()) assert.True(c3.nc.IsClosed()) - c4, c4e := cp.Get(o1) + c4, c4e := cp.Get(append(natsDefaults, append(natsOptions, o1...)...)) if assert.NoError(c4e) { assert.Same(c2, c4) } @@ -93,7 +93,7 @@ func TestConnPool(t *testing.T) { assert.True(c2.nc.IsClosed()) assert.True(c4.nc.IsClosed()) - c5, c5e := cp.Get(o1) + c5, c5e := cp.Get(append(natsDefaults, append(natsOptions, o1...)...)) if assert.NoError(c5e) { assert.NotSame(c1, c5) } diff --git a/surveyor/surveyor.go b/surveyor/surveyor.go index 4126940..a5e4bab 100644 --- a/surveyor/surveyor.go +++ b/surveyor/surveyor.go @@ -229,8 +229,7 @@ func (s *Surveyor) createStatszCollector() error { } s.statzC = NewStatzCollector(s.sysAcctPC.nc, s.logger, s.opts.ExpectedServers, s.opts.ServerResponseWait, s.opts.PollTimeout, s.opts.Accounts, s.opts.ConstLabels) - s.promRegistry.Register(s.statzC) - return nil + return s.promRegistry.Register(s.statzC) } // generates the TLS config for https