Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ Versioning](http://semver.org/spec/v2.0.0.html) except to the first release.

### Fixed

* Fixed the fluctuating behavior of the TestConnectionHandlerOpenUpdateClose test by increasing the waiting time (#502).

## [v2.4.1] - 2025-10-16

This maintenance release marks the end of active development on the `v2`
Expand Down
6 changes: 3 additions & 3 deletions pool/connection_pool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1115,15 +1115,15 @@ func TestConnectionHandlerOpenUpdateClose(t *testing.T) {
poolInstances := makeInstances(poolServers, connOpts)
roles := []bool{false, true}

ctx, cancel := test_helpers.GetPoolConnectContext()
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It would be better to increase the timeout here:

func GetPoolConnectContext() (context.Context, context.CancelFunc) {
return context.WithTimeout(context.Background(), time.Second)
}

30 seconds seems too much, but 5 seems good.

defer cancel()

err := test_helpers.SetClusterRO(ctx, makeDialers(poolServers), connOpts, roles)
require.Nilf(t, err, "fail to set roles for cluster")
require.NoError(t, err, "fail to set roles for cluster")

h := &testHandler{}
poolOpts := pool.Opts{
CheckTimeout: 100 * time.Microsecond,
CheckTimeout: 100 * time.Millisecond,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does the change required? Or is it enough to just increase the timeout for context?

ConnectionHandler: h,
}
connPool, err := pool.ConnectWithOpts(ctx, poolInstances, poolOpts)
Expand Down
Loading