mirror of
https://github.com/netbirdio/netbird.git
synced 2025-06-20 09:47:49 +02:00
[tests] Retry mysql store creation on reused containers (#3370)
This commit is contained in:
parent
dabdef4d67
commit
c8a558f797
4
.github/workflows/golang-test-linux.yml
vendored
4
.github/workflows/golang-test-linux.yml
vendored
@ -316,7 +316,7 @@ jobs:
|
|||||||
NETBIRD_STORE_ENGINE=${{ matrix.store }} \
|
NETBIRD_STORE_ENGINE=${{ matrix.store }} \
|
||||||
go test -tags=devcert \
|
go test -tags=devcert \
|
||||||
-exec "sudo --preserve-env=CI,NETBIRD_STORE_ENGINE" \
|
-exec "sudo --preserve-env=CI,NETBIRD_STORE_ENGINE" \
|
||||||
-timeout 10m ./management/...
|
-timeout 20m ./management/...
|
||||||
|
|
||||||
benchmark:
|
benchmark:
|
||||||
name: "Management / Benchmark"
|
name: "Management / Benchmark"
|
||||||
@ -508,7 +508,7 @@ jobs:
|
|||||||
NETBIRD_STORE_ENGINE=${{ matrix.store }} CI=true \
|
NETBIRD_STORE_ENGINE=${{ matrix.store }} CI=true \
|
||||||
go test -tags=integration \
|
go test -tags=integration \
|
||||||
-exec 'sudo --preserve-env=CI,NETBIRD_STORE_ENGINE' \
|
-exec 'sudo --preserve-env=CI,NETBIRD_STORE_ENGINE' \
|
||||||
-timeout 10m ./management/...
|
-timeout 20m ./management/...
|
||||||
|
|
||||||
test_client_on_docker:
|
test_client_on_docker:
|
||||||
name: "Client (Docker) / Unit"
|
name: "Client (Docker) / Unit"
|
||||||
|
@ -358,7 +358,18 @@ func NewTestStoreFromSQL(ctx context.Context, filename string, dataDir string) (
|
|||||||
return nil, nil, fmt.Errorf("failed to add all group to account: %v", err)
|
return nil, nil, fmt.Errorf("failed to add all group to account: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
return getSqlStoreEngine(ctx, store, kind)
|
|
||||||
|
maxRetries := 2
|
||||||
|
for i := 0; i < maxRetries; i++ {
|
||||||
|
sqlStore, cleanUp, err := getSqlStoreEngine(ctx, store, kind)
|
||||||
|
if err == nil {
|
||||||
|
return sqlStore, cleanUp, nil
|
||||||
|
}
|
||||||
|
if i < maxRetries-1 {
|
||||||
|
time.Sleep(100 * time.Millisecond)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return nil, nil, fmt.Errorf("failed to create test store after %d attempts: %v", maxRetries, err)
|
||||||
}
|
}
|
||||||
|
|
||||||
func addAllGroupToAccount(ctx context.Context, store Store) error {
|
func addAllGroupToAccount(ctx context.Context, store Store) error {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user