Skip to content

Commit 6f4180e

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 6f4180e

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

pool/connection_pool_test.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1115,21 +1115,23 @@ 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)
11301130
require.Nilf(t, err, "failed to connect")
11311131
require.NotNilf(t, connPool, "conn is nil after Connect")
11321132

1133+
time.Sleep(100 * time.Millisecond)
1134+
11331135
_, err = connPool.Do(tarantool.NewCall17Request("box.cfg").
11341136
Args([]interface{}{map[string]bool{
11351137
"read_only": true,

0 commit comments

Comments
 (0)