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 #282
  • Loading branch information
better0fdead authored and oleg-jukovec committed May 12, 2023
1 parent bc2537e commit 45a88ec
Show file tree
Hide file tree
Showing 14 changed files with 27 additions and 31 deletions.
2 changes: 1 addition & 1 deletion 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
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
2 changes: 1 addition & 1 deletion 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 Down
2 changes: 1 addition & 1 deletion 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
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
2 changes: 1 addition & 1 deletion 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
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
2 changes: 1 addition & 1 deletion 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
2 changes: 1 addition & 1 deletion 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
2 changes: 1 addition & 1 deletion tarantool_test.go
Original file line number Diff line number Diff line change
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
2 changes: 1 addition & 1 deletion 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

0 comments on commit 45a88ec

Please sign in to comment.