Skip to content

Commit a0bc666

Browse files
author
New year
committed
tests: fix flaky_TestConnectionHandlerOpenUpdateClose
-Increased the waiting time to milliseconds. -Changed the require.Nilf on require.NoError. Closes #502
1 parent aff7842 commit a0bc666

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ Versioning](http://semver.org/spec/v2.0.0.html) except to the first release.
2828

2929
### Fixed
3030

31+
* Fixed the fluctuating behavior of the TestConnectionHandlerOpenUpdateClose test by increasing the waiting time (#502).
32+
3133
## [v2.4.1] - 2025-10-16
3234

3335
This maintenance release marks the end of active development on the `v2`

pool/connection_pool_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1115,15 +1115,15 @@ func TestConnectionHandlerOpenUpdateClose(t *testing.T) {
11151115
poolInstances := makeInstances(poolServers, connOpts)
11161116
roles := []bool{false, true}
11171117

1118-
ctx, cancel := test_helpers.GetPoolConnectContext()
1118+
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
11191119
defer cancel()
11201120

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

11241124
h := &testHandler{}
11251125
poolOpts := pool.Opts{
1126-
CheckTimeout: 100 * time.Microsecond,
1126+
CheckTimeout: 100 * time.Millisecond,
11271127
ConnectionHandler: h,
11281128
}
11291129
connPool, err := pool.ConnectWithOpts(ctx, poolInstances, poolOpts)

0 commit comments

Comments
 (0)