From f3cdd6e1605153198b6a80ac7b50832f4f97c33d Mon Sep 17 00:00:00 2001 From: better0fdead Date: Mon, 10 Apr 2023 13:20:14 +0300 Subject: [PATCH] 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 #282 Closes #278 --- connection_pool/connection_pool_test.go | 2 +- crud/example_test.go | 2 +- crud/tarantool_test.go | 2 +- datetime/datetime_test.go | 2 +- decimal/example_test.go | 2 +- example_test.go | 14 +++++--------- multi/example_test.go | 4 ++-- multi/multi_test.go | 2 +- queue/example_connection_pool_test.go | 4 ++-- queue/example_msgpack_test.go | 8 ++++---- queue/queue_test.go | 2 +- settings/tarantool_test.go | 2 +- tarantool_test.go | 2 +- uuid/uuid_test.go | 2 +- 14 files changed, 23 insertions(+), 27 deletions(-) diff --git a/connection_pool/connection_pool_test.go b/connection_pool/connection_pool_test.go index 62e55ea3c..bb1391950 100644 --- a/connection_pool/connection_pool_test.go +++ b/connection_pool/connection_pool_test.go @@ -33,7 +33,7 @@ var servers = []string{ } var connOpts = tarantool.Opts{ - Timeout: 500 * time.Millisecond, + Timeout: 5 * time.Second, User: "test", Pass: "test", } diff --git a/crud/example_test.go b/crud/example_test.go index 3f2ebbf88..2b80212ca 100644 --- a/crud/example_test.go +++ b/crud/example_test.go @@ -15,7 +15,7 @@ const ( ) var exampleOpts = tarantool.Opts{ - Timeout: 500 * time.Millisecond, + Timeout: 5 * time.Second, User: "test", Pass: "test", } diff --git a/crud/tarantool_test.go b/crud/tarantool_test.go index 71f7d62b1..90c34bb25 100644 --- a/crud/tarantool_test.go +++ b/crud/tarantool_test.go @@ -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", } diff --git a/datetime/datetime_test.go b/datetime/datetime_test.go index f4cc8b2a1..4398c7f88 100644 --- a/datetime/datetime_test.go +++ b/datetime/datetime_test.go @@ -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", } diff --git a/decimal/example_test.go b/decimal/example_test.go index 1d335a4c3..346419125 100644 --- a/decimal/example_test.go +++ b/decimal/example_test.go @@ -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", diff --git a/example_test.go b/example_test.go index 7b0ee9a6a..62c9cf8ea 100644 --- a/example_test.go +++ b/example_test.go @@ -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, @@ -895,9 +895,7 @@ func ExampleConnection_Execute() { } server := "127.0.0.1:3013" opts := tarantool.Opts{ - Timeout: 500 * time.Millisecond, - Reconnect: 1 * time.Second, - MaxReconnects: 3, + Timeout: 5 * time.Second, User: "test", Pass: "test", } @@ -1015,9 +1013,7 @@ func ExampleConnection_NewPrepared() { server := "127.0.0.1:3013" opts := tarantool.Opts{ - Timeout: 500 * time.Millisecond, - Reconnect: 1 * time.Second, - MaxReconnects: 3, + Timeout: 5 * time.Second, User: "test", Pass: "test", } @@ -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", diff --git a/multi/example_test.go b/multi/example_test.go index e43461141..1ef369e4c 100644 --- a/multi/example_test.go +++ b/multi/example_test.go @@ -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", }) @@ -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{ diff --git a/multi/multi_test.go b/multi/multi_test.go index fc165d1d4..2dff7a0d1 100644 --- a/multi/multi_test.go +++ b/multi/multi_test.go @@ -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", } diff --git a/queue/example_connection_pool_test.go b/queue/example_connection_pool_test.go index e41cdc639..1cf174e70 100644 --- a/queue/example_connection_pool_test.go +++ b/queue/example_connection_pool_test.go @@ -140,12 +140,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) diff --git a/queue/example_msgpack_test.go b/queue/example_msgpack_test.go index 2ed7f5542..5b179f5c0 100644 --- a/queue/example_msgpack_test.go +++ b/queue/example_msgpack_test.go @@ -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", @@ -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, }, } diff --git a/queue/queue_test.go b/queue/queue_test.go index 0a3d4e919..6eaa05bd4 100644 --- a/queue/queue_test.go +++ b/queue/queue_test.go @@ -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, diff --git a/settings/tarantool_test.go b/settings/tarantool_test.go index d32767116..9183fb8e8 100644 --- a/settings/tarantool_test.go +++ b/settings/tarantool_test.go @@ -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", } diff --git a/tarantool_test.go b/tarantool_test.go index 125642dcf..4c54e003b 100644 --- a/tarantool_test.go +++ b/tarantool_test.go @@ -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, diff --git a/uuid/uuid_test.go b/uuid/uuid_test.go index e04ab5ab9..4e63310fa 100644 --- a/uuid/uuid_test.go +++ b/uuid/uuid_test.go @@ -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", }