Skip to content

Commit

Permalink
Fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
samuelattwood committed Jun 13, 2024
1 parent b92022a commit 54eb934
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
10 changes: 5 additions & 5 deletions surveyor/conn_pool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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)
}
Expand All @@ -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)
}
Expand Down
3 changes: 1 addition & 2 deletions surveyor/surveyor.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 54eb934

Please sign in to comment.