Skip to content

Commit e64edb7

Browse files
committed
chore: simplify wait strategies
1 parent 03e5d4d commit e64edb7

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

modules/azure/azurite/azurite.go

+2-7
Original file line numberDiff line numberDiff line change
@@ -96,27 +96,22 @@ func Run(ctx context.Context, img string, opts ...testcontainers.ContainerCustom
9696
// 2. evaluate the enabled services to apply the right wait strategy and Cmd options
9797
enabledServices := settings.EnabledServices
9898
if len(enabledServices) > 0 {
99-
waitingFor := make([]wait.Strategy, 0)
99+
waitingFor := make([]wait.Strategy, 0, len(enabledServices))
100100
for _, srv := range enabledServices {
101101
switch srv {
102102
case BlobService:
103103
genericContainerReq.Cmd = append(genericContainerReq.Cmd, "--blobHost", "0.0.0.0")
104104
waitingFor = append(waitingFor, wait.ForListeningPort(BlobPort))
105-
waitingFor = append(waitingFor, wait.ForLog("Blob service is successfully listening"))
106105
case QueueService:
107106
genericContainerReq.Cmd = append(genericContainerReq.Cmd, "--queueHost", "0.0.0.0")
108107
waitingFor = append(waitingFor, wait.ForListeningPort(QueuePort))
109-
waitingFor = append(waitingFor, wait.ForLog("Queue service is successfully listening"))
110108
case TableService:
111109
genericContainerReq.Cmd = append(genericContainerReq.Cmd, "--tableHost", "0.0.0.0")
112110
waitingFor = append(waitingFor, wait.ForListeningPort(TablePort))
113-
waitingFor = append(waitingFor, wait.ForLog("Table service is successfully listening"))
114111
}
115112
}
116113

117-
if len(waitingFor) > 0 {
118-
genericContainerReq.WaitingFor = wait.ForAll(waitingFor...)
119-
}
114+
genericContainerReq.WaitingFor = wait.ForAll(genericContainerReq.WaitingFor, wait.ForAll(waitingFor...))
120115
}
121116

122117
container, err := testcontainers.GenericContainer(ctx, genericContainerReq)

0 commit comments

Comments
 (0)