Skip to content

Commit 4ce2ff8

Browse files
New yearuser
authored andcommitted
tests: fix flaky_TestConnectionHandlerOpenUpdateClose
-Increased the waiting time to milliseconds. -Changed the require.Nilf on require.NoError. Closes #502
1 parent ea16f55 commit 4ce2ff8

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
@@ -33,6 +33,8 @@ Versioning](http://semver.org/spec/v2.0.0.html) except to the first release.
3333

3434
### Fixed
3535

36+
* Fixed the fluctuating behavior of the TestConnectionHandlerOpenUpdateClose test by increasing the waiting time (#502).
37+
3638
## [v2.4.1] - 2025-10-16
3739

3840
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)