Skip to content

Commit 521c0c3

Browse files
better0fdeadoleg-jukovec
authored andcommitted
test: increase timeout for all tests
Increased timeout for all test's server options. Have done it to solve the problem with macOs flaky tests. Closes #277 Closes #282 Closes #291
1 parent 60111b3 commit 521c0c3

18 files changed

+41
-44
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ Versioning](http://semver.org/spec/v2.0.0.html) except to the first release.
2929
- Connect() panics on concurrent schema update (#278)
3030
- Wrong Ttr setup by Queue.Cfg() (#278)
3131
- Flaky queue/Example_connectionPool (#278)
32+
- Flaky queue/Example_simpleQueueCustomMsgPack (#277)
3233

3334
## [1.10.0] - 2022-12-31
3435

connection_pool/connection_pool_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ var servers = []string{
3333
}
3434

3535
var connOpts = tarantool.Opts{
36-
Timeout: 500 * time.Millisecond,
36+
Timeout: 5 * time.Second,
3737
User: "test",
3838
Pass: "test",
3939
}
@@ -2426,7 +2426,7 @@ func TestWatcher_Unregister_concurrent(t *testing.T) {
24262426
func runTestMain(m *testing.M) int {
24272427
initScript := "config.lua"
24282428
waitStart := 100 * time.Millisecond
2429-
connectRetry := 3
2429+
connectRetry := 10
24302430
retryTimeout := 500 * time.Millisecond
24312431

24322432
// Tarantool supports streams and interactive transactions since version 2.10.0

crud/example_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ const (
1515
)
1616

1717
var exampleOpts = tarantool.Opts{
18-
Timeout: 500 * time.Millisecond,
18+
Timeout: 5 * time.Second,
1919
User: "test",
2020
Pass: "test",
2121
}

crud/tarantool_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ var invalidSpaceName = "invalid"
2020
var indexNo = uint32(0)
2121
var indexName = "primary_index"
2222
var opts = tarantool.Opts{
23-
Timeout: 500 * time.Millisecond,
23+
Timeout: 5 * time.Second,
2424
User: "test",
2525
Pass: "test",
2626
}
@@ -31,7 +31,7 @@ var startOpts test_helpers.StartOpts = test_helpers.StartOpts{
3131
User: opts.User,
3232
Pass: opts.Pass,
3333
WaitStart: 100 * time.Millisecond,
34-
ConnectRetry: 3,
34+
ConnectRetry: 10,
3535
RetryTimeout: 500 * time.Millisecond,
3636
}
3737

datetime/datetime_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ var isDatetimeSupported = false
3737

3838
var server = "127.0.0.1:3013"
3939
var opts = Opts{
40-
Timeout: 500 * time.Millisecond,
40+
Timeout: 5 * time.Second,
4141
User: "test",
4242
Pass: "test",
4343
}
@@ -1144,7 +1144,7 @@ func runTestMain(m *testing.M) int {
11441144
User: opts.User,
11451145
Pass: opts.Pass,
11461146
WaitStart: 100 * time.Millisecond,
1147-
ConnectRetry: 3,
1147+
ConnectRetry: 10,
11481148
RetryTimeout: 500 * time.Millisecond,
11491149
})
11501150
defer test_helpers.StopTarantoolWithCleanup(instance)

decimal/decimal_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -616,7 +616,7 @@ func runTestMain(m *testing.M) int {
616616
User: opts.User,
617617
Pass: opts.Pass,
618618
WaitStart: 100 * time.Millisecond,
619-
ConnectRetry: 3,
619+
ConnectRetry: 10,
620620
RetryTimeout: 500 * time.Millisecond,
621621
})
622622
defer test_helpers.StopTarantoolWithCleanup(instance)

decimal/example_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ import (
2222
func Example() {
2323
server := "127.0.0.1:3013"
2424
opts := tarantool.Opts{
25-
Timeout: 500 * time.Millisecond,
25+
Timeout: 5 * time.Second,
2626
Reconnect: 1 * time.Second,
2727
MaxReconnects: 3,
2828
User: "test",

example_test.go

+9-13
Original file line numberDiff line numberDiff line change
@@ -799,7 +799,7 @@ func ExampleConnection_Eval() {
799799

800800
func ExampleConnect() {
801801
conn, err := tarantool.Connect("127.0.0.1:3013", tarantool.Opts{
802-
Timeout: 500 * time.Millisecond,
802+
Timeout: 5 * time.Second,
803803
User: "test",
804804
Pass: "test",
805805
Concurrency: 32,
@@ -895,11 +895,9 @@ func ExampleConnection_Execute() {
895895
}
896896
server := "127.0.0.1:3013"
897897
opts := tarantool.Opts{
898-
Timeout: 500 * time.Millisecond,
899-
Reconnect: 1 * time.Second,
900-
MaxReconnects: 3,
901-
User: "test",
902-
Pass: "test",
898+
Timeout: 5 * time.Second,
899+
User: "test",
900+
Pass: "test",
903901
}
904902
client, err := tarantool.Connect(server, opts)
905903
if err != nil {
@@ -1015,11 +1013,9 @@ func ExampleConnection_NewPrepared() {
10151013

10161014
server := "127.0.0.1:3013"
10171015
opts := tarantool.Opts{
1018-
Timeout: 500 * time.Millisecond,
1019-
Reconnect: 1 * time.Second,
1020-
MaxReconnects: 3,
1021-
User: "test",
1022-
Pass: "test",
1016+
Timeout: 5 * time.Second,
1017+
User: "test",
1018+
Pass: "test",
10231019
}
10241020
conn, err := tarantool.Connect(server, opts)
10251021
if err != nil {
@@ -1057,8 +1053,8 @@ func ExampleConnection_NewWatcher() {
10571053

10581054
server := "127.0.0.1:3013"
10591055
opts := tarantool.Opts{
1060-
Timeout: 500 * time.Millisecond,
1061-
Reconnect: 1 * time.Second,
1056+
Timeout: 5 * time.Second,
1057+
Reconnect: 5 * time.Second,
10621058
MaxReconnects: 3,
10631059
User: "test",
10641060
Pass: "test",

multi/example_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import (
99

1010
func ExampleConnect() {
1111
multiConn, err := Connect([]string{"127.0.0.1:3031", "127.0.0.1:3032"}, tarantool.Opts{
12-
Timeout: 500 * time.Millisecond,
12+
Timeout: 5 * time.Second,
1313
User: "test",
1414
Pass: "test",
1515
})
@@ -21,7 +21,7 @@ func ExampleConnect() {
2121

2222
func ExampleConnectWithOpts() {
2323
multiConn, err := ConnectWithOpts([]string{"127.0.0.1:3301", "127.0.0.1:3302"}, tarantool.Opts{
24-
Timeout: 500 * time.Millisecond,
24+
Timeout: 5 * time.Second,
2525
User: "test",
2626
Pass: "test",
2727
}, OptsMulti{

multi/multi_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ var spaceNo = uint32(617)
2020
var spaceName = "test"
2121
var indexNo = uint32(0)
2222
var connOpts = tarantool.Opts{
23-
Timeout: 500 * time.Millisecond,
23+
Timeout: 5 * time.Second,
2424
User: "test",
2525
Pass: "test",
2626
}
@@ -611,7 +611,7 @@ func TestConnectionMulti_NewWatcher(t *testing.T) {
611611
func runTestMain(m *testing.M) int {
612612
initScript := "config.lua"
613613
waitStart := 100 * time.Millisecond
614-
connectRetry := 3
614+
connectRetry := 10
615615
retryTimeout := 500 * time.Millisecond
616616

617617
// Tarantool supports streams and interactive transactions since version 2.10.0

queue/example_connection_pool_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -156,12 +156,12 @@ func Example_connectionPool() {
156156
"127.0.0.1:3015",
157157
}
158158
connOpts := tarantool.Opts{
159-
Timeout: 1 * time.Second,
159+
Timeout: 5 * time.Second,
160160
User: "test",
161161
Pass: "test",
162162
}
163163
poolOpts := connection_pool.OptsPool{
164-
CheckTimeout: 1 * time.Second,
164+
CheckTimeout: 5 * time.Second,
165165
ConnectionHandler: h,
166166
}
167167
connPool, err := connection_pool.ConnectWithOpts(servers, connOpts, poolOpts)

queue/example_msgpack_test.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ func (c *dummyData) EncodeMsgpack(e *encoder) error {
4848
func Example_simpleQueueCustomMsgPack() {
4949
opts := tarantool.Opts{
5050
Reconnect: time.Second,
51-
Timeout: 2500 * time.Millisecond,
51+
Timeout: 5 * time.Second,
5252
MaxReconnects: 5,
5353
User: "test",
5454
Pass: "test",
@@ -65,9 +65,9 @@ func Example_simpleQueueCustomMsgPack() {
6565
IfNotExists: true,
6666
Kind: queue.FIFO,
6767
Opts: queue.Opts{
68-
Ttl: 10 * time.Second,
69-
Ttr: 5 * time.Second,
70-
Delay: 3 * time.Second,
68+
Ttl: 20 * time.Second,
69+
Ttr: 10 * time.Second,
70+
Delay: 6 * time.Second,
7171
Pri: 1,
7272
},
7373
}

queue/queue_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ var serversPool = []string{
2222
var instances []test_helpers.TarantoolInstance
2323

2424
var opts = Opts{
25-
Timeout: 2500 * time.Millisecond,
25+
Timeout: 5 * time.Second,
2626
User: "test",
2727
Pass: "test",
2828
//Concurrency: 32,
@@ -913,7 +913,7 @@ func runTestMain(m *testing.M) int {
913913
User: opts.User,
914914
Pass: opts.Pass,
915915
WaitStart: 100 * time.Millisecond,
916-
ConnectRetry: 3,
916+
ConnectRetry: 10,
917917
RetryTimeout: 500 * time.Millisecond,
918918
})
919919

settings/tarantool_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ var isSettingsSupported = false
1919

2020
var server = "127.0.0.1:3013"
2121
var opts = tarantool.Opts{
22-
Timeout: 500 * time.Millisecond,
22+
Timeout: 5 * time.Second,
2323
User: "test",
2424
Pass: "test",
2525
}
@@ -637,7 +637,7 @@ func runTestMain(m *testing.M) int {
637637
User: opts.User,
638638
Pass: opts.Pass,
639639
WaitStart: 100 * time.Millisecond,
640-
ConnectRetry: 3,
640+
ConnectRetry: 10,
641641
RetryTimeout: 500 * time.Millisecond,
642642
})
643643

shutdown_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ var shtdnClntOpts = Opts{
2222
User: opts.User,
2323
Pass: opts.Pass,
2424
Timeout: 20 * time.Second,
25-
Reconnect: 200 * time.Millisecond,
25+
Reconnect: 500 * time.Millisecond,
2626
MaxReconnects: 10,
2727
RequiredProtocolInfo: ProtocolInfo{Features: []ProtocolFeature{WatchersFeature}},
2828
}
@@ -32,7 +32,7 @@ var shtdnSrvOpts = test_helpers.StartOpts{
3232
User: shtdnClntOpts.User,
3333
Pass: shtdnClntOpts.Pass,
3434
WaitStart: 100 * time.Millisecond,
35-
ConnectRetry: 3,
35+
ConnectRetry: 10,
3636
RetryTimeout: 500 * time.Millisecond,
3737
}
3838

ssl_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@ func serverTnt(serverOpts, clientOpts SslOpts, auth Auth) (test_helpers.Tarantoo
130130
User: "test",
131131
Pass: "test",
132132
WaitStart: 100 * time.Millisecond,
133-
ConnectRetry: 3,
133+
ConnectRetry: 10,
134134
RetryTimeout: 500 * time.Millisecond,
135135
})
136136
}

tarantool_test.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ var startOpts test_helpers.StartOpts = test_helpers.StartOpts{
2828
User: opts.User,
2929
Pass: opts.Pass,
3030
WaitStart: 100 * time.Millisecond,
31-
ConnectRetry: 3,
31+
ConnectRetry: 10,
3232
RetryTimeout: 500 * time.Millisecond,
3333
}
3434

@@ -75,7 +75,7 @@ var spaceName = "test"
7575
var indexNo = uint32(0)
7676
var indexName = "primary"
7777
var opts = Opts{
78-
Timeout: 500 * time.Millisecond,
78+
Timeout: 5 * time.Second,
7979
User: "test",
8080
Pass: "test",
8181
//Concurrency: 32,
@@ -3580,7 +3580,7 @@ func TestConnection_NewWatcher_reconnect(t *testing.T) {
35803580
User: opts.User,
35813581
Pass: opts.Pass,
35823582
WaitStart: 100 * time.Millisecond,
3583-
ConnectRetry: 3,
3583+
ConnectRetry: 10,
35843584
RetryTimeout: 500 * time.Millisecond,
35853585
})
35863586
defer test_helpers.StopTarantoolWithCleanup(inst)

uuid/uuid_test.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ var isUUIDSupported = false
2020

2121
var server = "127.0.0.1:3013"
2222
var opts = Opts{
23-
Timeout: 500 * time.Millisecond,
23+
Timeout: 5 * time.Second,
2424
User: "test",
2525
Pass: "test",
2626
}
@@ -158,7 +158,7 @@ func runTestMain(m *testing.M) int {
158158
User: opts.User,
159159
Pass: opts.Pass,
160160
WaitStart: 100 * time.Millisecond,
161-
ConnectRetry: 3,
161+
ConnectRetry: 10,
162162
RetryTimeout: 500 * time.Millisecond,
163163
})
164164
defer test_helpers.StopTarantoolWithCleanup(inst)

0 commit comments

Comments
 (0)