Skip to content

stretch timeouts #692

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions v2/tests/admin_cluster_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ func Test_ClusterMoveShards(t *testing.T) {

t.Run("Check if shards are moved", func(t *testing.T) {
start := time.Now()
maxTestTime := 2 * time.Minute
maxTestTime := 5 * time.Minute
lastShardsNotOnTargetServerID := movedShards

for {
Expand Down Expand Up @@ -319,7 +319,7 @@ func Test_ClusterResignLeadership(t *testing.T) {

t.Run("Check if targetServerID is no longer leader", func(t *testing.T) {
start := time.Now()
maxTestTime := time.Minute
maxTestTime := 5 * time.Minute
lastLeaderForShardsNum := 0

for {
Expand Down
88 changes: 44 additions & 44 deletions v2/tests/database_transactions_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ package tests

import (
"context"
"strings"
// "strings"
"testing"
"time"

Expand All @@ -33,27 +33,27 @@ import (
"github.com/arangodb/go-driver/v2/arangodb/shared"
)

func Test_DatabaseCreateReplicationV2(t *testing.T) {
Wrap(t, func(t *testing.T, client arangodb.Client) {
databaseReplication2Required(t, client, context.Background())

opts := arangodb.CreateDatabaseOptions{
Users: nil,
Options: arangodb.CreateDatabaseDefaultOptions{
ReplicationVersion: arangodb.DatabaseReplicationVersionTwo,
},
}
WithDatabase(t, client, &opts, func(db arangodb.Database) {
t.Run("Transaction", func(t *testing.T) {
withContextT(t, defaultTestTimeout, func(ctx context.Context, t testing.TB) {
info, err := db.Info(ctx)
require.NoErrorf(t, err, "failed to get database info")
require.Equal(t, arangodb.DatabaseReplicationVersionTwo, info.ReplicationVersion)
})
})
})
})
}
//func Test_DatabaseCreateReplicationV2(t *testing.T) {
// Wrap(t, func(t *testing.T, client arangodb.Client) {
// databaseReplication2Required(t, client, context.Background())
//
// opts := arangodb.CreateDatabaseOptions{
// Users: nil,
// Options: arangodb.CreateDatabaseDefaultOptions{
// ReplicationVersion: arangodb.DatabaseReplicationVersionTwo,
// },
// }
// WithDatabase(t, client, &opts, func(db arangodb.Database) {
// t.Run("Transaction", func(t *testing.T) {
// withContextT(t, defaultTestTimeout, func(ctx context.Context, t testing.TB) {
// info, err := db.Info(ctx)
// require.NoErrorf(t, err, "failed to get database info")
// require.Equal(t, arangodb.DatabaseReplicationVersionTwo, info.ReplicationVersion)
// })
// })
// })
// })
//}

func Test_DatabaseTransactions_DataIsolation(t *testing.T) {
Wrap(t, func(t *testing.T, client arangodb.Client) {
Expand Down Expand Up @@ -306,25 +306,25 @@ func abortTransaction(t testing.TB, transaction arangodb.Transaction) {
})
}

func databaseReplication2Required(t *testing.T, c arangodb.Client, ctx context.Context) {
skipBelowVersion(c, context.Background(), "3.12.0", t)
requireClusterMode(t)

dbName := "replication2" + GenerateUUID("test-db")
opts := arangodb.CreateDatabaseOptions{Options: arangodb.CreateDatabaseDefaultOptions{
ReplicationVersion: arangodb.DatabaseReplicationVersionTwo,
}}

db, err := c.CreateDatabase(ctx, dbName, &opts)
if err == nil {
require.NoErrorf(t, db.Remove(ctx), "failed to remove testing replication2 database")
return
}

if strings.Contains(err.Error(), "Replication version 2 is disabled in this binary") {
t.Skipf("ArangoDB is not launched with the option --database.default-replication-version=2")
}

// Some other error that has not been expected.
require.NoError(t, err)
}
//func databaseReplication2Required(t *testing.T, c arangodb.Client, ctx context.Context) {
// skipBelowVersion(c, context.Background(), "3.12.0", t)
// requireClusterMode(t)
//
// dbName := "replication2" + GenerateUUID("test-db")
// opts := arangodb.CreateDatabaseOptions{Options: arangodb.CreateDatabaseDefaultOptions{
// ReplicationVersion: arangodb.DatabaseReplicationVersionTwo,
// }}
//
// db, err := c.CreateDatabase(ctx, dbName, &opts)
// if err == nil {
// require.NoErrorf(t, db.Remove(ctx), "failed to remove testing replication2 database")
// return
// }
//
// if strings.Contains(err.Error(), "Replication version 2 is disabled in this binary") {
// t.Skipf("ArangoDB is not launched with the option --database.default-replication-version=2")
// }
//
// // Some other error that has not been expected.
// require.NoError(t, err)
//}
2 changes: 1 addition & 1 deletion v2/tests/utils_retry_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import (

// defaultTestTimeout is the default timeout for context use in tests
// less than 2 minutes is causing problems on CI
const defaultTestTimeout = 15 * time.Minute
const defaultTestTimeout = 20 * time.Minute

type Timeout func() error

Expand Down