Skip to content

Commit

Permalink
test: increase timeout for all tests
Browse files Browse the repository at this point in the history
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
  • Loading branch information
better0fdead authored and oleg-jukovec committed May 18, 2023
1 parent 60111b3 commit 521c0c3
Show file tree
Hide file tree
Showing 18 changed files with 41 additions and 44 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ Versioning](http://semver.org/spec/v2.0.0.html) except to the first release.
- Connect() panics on concurrent schema update (#278)
- Wrong Ttr setup by Queue.Cfg() (#278)
- Flaky queue/Example_connectionPool (#278)
- Flaky queue/Example_simpleQueueCustomMsgPack (#277)

## [1.10.0] - 2022-12-31

Expand Down
4 changes: 2 additions & 2 deletions connection_pool/connection_pool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ var servers = []string{
}

var connOpts = tarantool.Opts{
Timeout: 500 * time.Millisecond,
Timeout: 5 * time.Second,
User: "test",
Pass: "test",
}
Expand Down Expand Up @@ -2426,7 +2426,7 @@ func TestWatcher_Unregister_concurrent(t *testing.T) {
func runTestMain(m *testing.M) int {
initScript := "config.lua"
waitStart := 100 * time.Millisecond
connectRetry := 3
connectRetry := 10
retryTimeout := 500 * time.Millisecond

// Tarantool supports streams and interactive transactions since version 2.10.0
Expand Down
2 changes: 1 addition & 1 deletion crud/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const (
)

var exampleOpts = tarantool.Opts{
Timeout: 500 * time.Millisecond,
Timeout: 5 * time.Second,
User: "test",
Pass: "test",
}
Expand Down
4 changes: 2 additions & 2 deletions crud/tarantool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ var invalidSpaceName = "invalid"
var indexNo = uint32(0)
var indexName = "primary_index"
var opts = tarantool.Opts{
Timeout: 500 * time.Millisecond,
Timeout: 5 * time.Second,
User: "test",
Pass: "test",
}
Expand All @@ -31,7 +31,7 @@ var startOpts test_helpers.StartOpts = test_helpers.StartOpts{
User: opts.User,
Pass: opts.Pass,
WaitStart: 100 * time.Millisecond,
ConnectRetry: 3,
ConnectRetry: 10,
RetryTimeout: 500 * time.Millisecond,
}

Expand Down
4 changes: 2 additions & 2 deletions datetime/datetime_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ var isDatetimeSupported = false

var server = "127.0.0.1:3013"
var opts = Opts{
Timeout: 500 * time.Millisecond,
Timeout: 5 * time.Second,
User: "test",
Pass: "test",
}
Expand Down Expand Up @@ -1144,7 +1144,7 @@ func runTestMain(m *testing.M) int {
User: opts.User,
Pass: opts.Pass,
WaitStart: 100 * time.Millisecond,
ConnectRetry: 3,
ConnectRetry: 10,
RetryTimeout: 500 * time.Millisecond,
})
defer test_helpers.StopTarantoolWithCleanup(instance)
Expand Down
2 changes: 1 addition & 1 deletion decimal/decimal_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -616,7 +616,7 @@ func runTestMain(m *testing.M) int {
User: opts.User,
Pass: opts.Pass,
WaitStart: 100 * time.Millisecond,
ConnectRetry: 3,
ConnectRetry: 10,
RetryTimeout: 500 * time.Millisecond,
})
defer test_helpers.StopTarantoolWithCleanup(instance)
Expand Down
2 changes: 1 addition & 1 deletion decimal/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import (
func Example() {
server := "127.0.0.1:3013"
opts := tarantool.Opts{
Timeout: 500 * time.Millisecond,
Timeout: 5 * time.Second,
Reconnect: 1 * time.Second,
MaxReconnects: 3,
User: "test",
Expand Down
22 changes: 9 additions & 13 deletions example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -799,7 +799,7 @@ func ExampleConnection_Eval() {

func ExampleConnect() {
conn, err := tarantool.Connect("127.0.0.1:3013", tarantool.Opts{
Timeout: 500 * time.Millisecond,
Timeout: 5 * time.Second,
User: "test",
Pass: "test",
Concurrency: 32,
Expand Down Expand Up @@ -895,11 +895,9 @@ func ExampleConnection_Execute() {
}
server := "127.0.0.1:3013"
opts := tarantool.Opts{
Timeout: 500 * time.Millisecond,
Reconnect: 1 * time.Second,
MaxReconnects: 3,
User: "test",
Pass: "test",
Timeout: 5 * time.Second,
User: "test",
Pass: "test",
}
client, err := tarantool.Connect(server, opts)
if err != nil {
Expand Down Expand Up @@ -1015,11 +1013,9 @@ func ExampleConnection_NewPrepared() {

server := "127.0.0.1:3013"
opts := tarantool.Opts{
Timeout: 500 * time.Millisecond,
Reconnect: 1 * time.Second,
MaxReconnects: 3,
User: "test",
Pass: "test",
Timeout: 5 * time.Second,
User: "test",
Pass: "test",
}
conn, err := tarantool.Connect(server, opts)
if err != nil {
Expand Down Expand Up @@ -1057,8 +1053,8 @@ func ExampleConnection_NewWatcher() {

server := "127.0.0.1:3013"
opts := tarantool.Opts{
Timeout: 500 * time.Millisecond,
Reconnect: 1 * time.Second,
Timeout: 5 * time.Second,
Reconnect: 5 * time.Second,
MaxReconnects: 3,
User: "test",
Pass: "test",
Expand Down
4 changes: 2 additions & 2 deletions multi/example_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

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

func ExampleConnectWithOpts() {
multiConn, err := ConnectWithOpts([]string{"127.0.0.1:3301", "127.0.0.1:3302"}, tarantool.Opts{
Timeout: 500 * time.Millisecond,
Timeout: 5 * time.Second,
User: "test",
Pass: "test",
}, OptsMulti{
Expand Down
4 changes: 2 additions & 2 deletions multi/multi_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ var spaceNo = uint32(617)
var spaceName = "test"
var indexNo = uint32(0)
var connOpts = tarantool.Opts{
Timeout: 500 * time.Millisecond,
Timeout: 5 * time.Second,
User: "test",
Pass: "test",
}
Expand Down Expand Up @@ -611,7 +611,7 @@ func TestConnectionMulti_NewWatcher(t *testing.T) {
func runTestMain(m *testing.M) int {
initScript := "config.lua"
waitStart := 100 * time.Millisecond
connectRetry := 3
connectRetry := 10
retryTimeout := 500 * time.Millisecond

// Tarantool supports streams and interactive transactions since version 2.10.0
Expand Down
4 changes: 2 additions & 2 deletions queue/example_connection_pool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,12 @@ func Example_connectionPool() {
"127.0.0.1:3015",
}
connOpts := tarantool.Opts{
Timeout: 1 * time.Second,
Timeout: 5 * time.Second,
User: "test",
Pass: "test",
}
poolOpts := connection_pool.OptsPool{
CheckTimeout: 1 * time.Second,
CheckTimeout: 5 * time.Second,
ConnectionHandler: h,
}
connPool, err := connection_pool.ConnectWithOpts(servers, connOpts, poolOpts)
Expand Down
8 changes: 4 additions & 4 deletions queue/example_msgpack_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func (c *dummyData) EncodeMsgpack(e *encoder) error {
func Example_simpleQueueCustomMsgPack() {
opts := tarantool.Opts{
Reconnect: time.Second,
Timeout: 2500 * time.Millisecond,
Timeout: 5 * time.Second,
MaxReconnects: 5,
User: "test",
Pass: "test",
Expand All @@ -65,9 +65,9 @@ func Example_simpleQueueCustomMsgPack() {
IfNotExists: true,
Kind: queue.FIFO,
Opts: queue.Opts{
Ttl: 10 * time.Second,
Ttr: 5 * time.Second,
Delay: 3 * time.Second,
Ttl: 20 * time.Second,
Ttr: 10 * time.Second,
Delay: 6 * time.Second,
Pri: 1,
},
}
Expand Down
4 changes: 2 additions & 2 deletions queue/queue_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ var serversPool = []string{
var instances []test_helpers.TarantoolInstance

var opts = Opts{
Timeout: 2500 * time.Millisecond,
Timeout: 5 * time.Second,
User: "test",
Pass: "test",
//Concurrency: 32,
Expand Down Expand Up @@ -913,7 +913,7 @@ func runTestMain(m *testing.M) int {
User: opts.User,
Pass: opts.Pass,
WaitStart: 100 * time.Millisecond,
ConnectRetry: 3,
ConnectRetry: 10,
RetryTimeout: 500 * time.Millisecond,
})

Expand Down
4 changes: 2 additions & 2 deletions settings/tarantool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ var isSettingsSupported = false

var server = "127.0.0.1:3013"
var opts = tarantool.Opts{
Timeout: 500 * time.Millisecond,
Timeout: 5 * time.Second,
User: "test",
Pass: "test",
}
Expand Down Expand Up @@ -637,7 +637,7 @@ func runTestMain(m *testing.M) int {
User: opts.User,
Pass: opts.Pass,
WaitStart: 100 * time.Millisecond,
ConnectRetry: 3,
ConnectRetry: 10,
RetryTimeout: 500 * time.Millisecond,
})

Expand Down
4 changes: 2 additions & 2 deletions shutdown_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ var shtdnClntOpts = Opts{
User: opts.User,
Pass: opts.Pass,
Timeout: 20 * time.Second,
Reconnect: 200 * time.Millisecond,
Reconnect: 500 * time.Millisecond,
MaxReconnects: 10,
RequiredProtocolInfo: ProtocolInfo{Features: []ProtocolFeature{WatchersFeature}},
}
Expand All @@ -32,7 +32,7 @@ var shtdnSrvOpts = test_helpers.StartOpts{
User: shtdnClntOpts.User,
Pass: shtdnClntOpts.Pass,
WaitStart: 100 * time.Millisecond,
ConnectRetry: 3,
ConnectRetry: 10,
RetryTimeout: 500 * time.Millisecond,
}

Expand Down
2 changes: 1 addition & 1 deletion ssl_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ func serverTnt(serverOpts, clientOpts SslOpts, auth Auth) (test_helpers.Tarantoo
User: "test",
Pass: "test",
WaitStart: 100 * time.Millisecond,
ConnectRetry: 3,
ConnectRetry: 10,
RetryTimeout: 500 * time.Millisecond,
})
}
Expand Down
6 changes: 3 additions & 3 deletions tarantool_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ var startOpts test_helpers.StartOpts = test_helpers.StartOpts{
User: opts.User,
Pass: opts.Pass,
WaitStart: 100 * time.Millisecond,
ConnectRetry: 3,
ConnectRetry: 10,
RetryTimeout: 500 * time.Millisecond,
}

Expand Down Expand Up @@ -75,7 +75,7 @@ var spaceName = "test"
var indexNo = uint32(0)
var indexName = "primary"
var opts = Opts{
Timeout: 500 * time.Millisecond,
Timeout: 5 * time.Second,
User: "test",
Pass: "test",
//Concurrency: 32,
Expand Down Expand Up @@ -3580,7 +3580,7 @@ func TestConnection_NewWatcher_reconnect(t *testing.T) {
User: opts.User,
Pass: opts.Pass,
WaitStart: 100 * time.Millisecond,
ConnectRetry: 3,
ConnectRetry: 10,
RetryTimeout: 500 * time.Millisecond,
})
defer test_helpers.StopTarantoolWithCleanup(inst)
Expand Down
4 changes: 2 additions & 2 deletions uuid/uuid_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ var isUUIDSupported = false

var server = "127.0.0.1:3013"
var opts = Opts{
Timeout: 500 * time.Millisecond,
Timeout: 5 * time.Second,
User: "test",
Pass: "test",
}
Expand Down Expand Up @@ -158,7 +158,7 @@ func runTestMain(m *testing.M) int {
User: opts.User,
Pass: opts.Pass,
WaitStart: 100 * time.Millisecond,
ConnectRetry: 3,
ConnectRetry: 10,
RetryTimeout: 500 * time.Millisecond,
})
defer test_helpers.StopTarantoolWithCleanup(inst)
Expand Down

0 comments on commit 521c0c3

Please sign in to comment.