diff --git a/CHANGELOG.md b/CHANGELOG.md index 42746418c..443b5b90b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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` diff --git a/pool/connection_pool_test.go b/pool/connection_pool_test.go index f4a0376d4..bb6647cf0 100644 --- a/pool/connection_pool_test.go +++ b/pool/connection_pool_test.go @@ -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) 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, ConnectionHandler: h, } connPool, err := pool.ConnectWithOpts(ctx, poolInstances, poolOpts)