mirror of
https://github.com/hashicorp/vault.git
synced 2026-05-05 12:26:34 +02:00
testhelpers(ldap): always time out if we can't start the container in 1 minute (#31509)
Signed-off-by: Ryan Cragun <me@ryan.ec>
This commit is contained in:
parent
04295060d1
commit
4c3a440e1f
@ -10,6 +10,7 @@ import (
|
||||
"runtime"
|
||||
"strings"
|
||||
"testing"
|
||||
"time"
|
||||
|
||||
"github.com/hashicorp/cap/ldap"
|
||||
"github.com/hashicorp/vault/sdk/helper/docker"
|
||||
@ -55,8 +56,9 @@ func PrepareTestContainer(t *testing.T, version string) (cleanup func(), cfg *ld
|
||||
|
||||
var started bool
|
||||
|
||||
ctx, _ := context.WithTimeout(t.Context(), 1*time.Minute)
|
||||
for i := 0; i < 3; i++ {
|
||||
svc, err := runner.StartService(context.Background(), func(ctx context.Context, host string, port int) (docker.ServiceConfig, error) {
|
||||
svc, err := runner.StartService(ctx, func(ctx context.Context, host string, port int) (docker.ServiceConfig, error) {
|
||||
connURL := fmt.Sprintf("ldap://%s:%d", host, port)
|
||||
cfg.Url = connURL
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user