Skip to content

Commit 5383c08

Browse files
backport of commit 4c3a440 (#31510)
Co-authored-by: Ryan Cragun <[email protected]>
1 parent 8aaf19f commit 5383c08

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

helper/testhelpers/ldap/ldaphelper.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
"runtime"
1111
"strings"
1212
"testing"
13+
"time"
1314

1415
"github.com/hashicorp/cap/ldap"
1516
"github.com/hashicorp/vault/sdk/helper/docker"
@@ -55,8 +56,9 @@ func PrepareTestContainer(t *testing.T, version string) (cleanup func(), cfg *ld
5556

5657
var started bool
5758

59+
ctx, _ := context.WithTimeout(t.Context(), 1*time.Minute)
5860
for i := 0; i < 3; i++ {
59-
svc, err := runner.StartService(context.Background(), func(ctx context.Context, host string, port int) (docker.ServiceConfig, error) {
61+
svc, err := runner.StartService(ctx, func(ctx context.Context, host string, port int) (docker.ServiceConfig, error) {
6062
connURL := fmt.Sprintf("ldap://%s:%d", host, port)
6163
cfg.Url = connURL
6264

0 commit comments

Comments
 (0)