Skip to content

Commit

Permalink
bugfix: flaky TestAdd_Close<Graceful>_concurrent
Browse files Browse the repository at this point in the history
We need to add non-added endpoint to avoid `endpoint exist` error.
  • Loading branch information
oleg-jukovec committed Jun 6, 2023
1 parent 1427a2d commit 0d8e4ae
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions connection_pool/connection_pool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -345,9 +345,9 @@ func TestAdd_Close_concurrent(t *testing.T) {
go func() {
defer wg.Done()

err = connPool.Add(servers[0])
err = connPool.Add(servers[1])
if err != nil {
assert.Equal(t, err, connection_pool.ErrClosed)
assert.Equal(t, connection_pool.ErrClosed, err)
}
}()

Expand All @@ -366,9 +366,9 @@ func TestAdd_CloseGraceful_concurrent(t *testing.T) {
go func() {
defer wg.Done()

err = connPool.Add(servers[0])
err = connPool.Add(servers[1])
if err != nil {
assert.Equal(t, err, connection_pool.ErrClosed)
assert.Equal(t, connection_pool.ErrClosed, err)
}
}()

Expand Down

0 comments on commit 0d8e4ae

Please sign in to comment.