@@ -96,27 +96,22 @@ func Run(ctx context.Context, img string, opts ...testcontainers.ContainerCustom
96
96
// 2. evaluate the enabled services to apply the right wait strategy and Cmd options
97
97
enabledServices := settings .EnabledServices
98
98
if len (enabledServices ) > 0 {
99
- waitingFor := make ([]wait.Strategy , 0 )
99
+ waitingFor := make ([]wait.Strategy , 0 , len ( enabledServices ) )
100
100
for _ , srv := range enabledServices {
101
101
switch srv {
102
102
case BlobService :
103
103
genericContainerReq .Cmd = append (genericContainerReq .Cmd , "--blobHost" , "0.0.0.0" )
104
104
waitingFor = append (waitingFor , wait .ForListeningPort (BlobPort ))
105
- waitingFor = append (waitingFor , wait .ForLog ("Blob service is successfully listening" ))
106
105
case QueueService :
107
106
genericContainerReq .Cmd = append (genericContainerReq .Cmd , "--queueHost" , "0.0.0.0" )
108
107
waitingFor = append (waitingFor , wait .ForListeningPort (QueuePort ))
109
- waitingFor = append (waitingFor , wait .ForLog ("Queue service is successfully listening" ))
110
108
case TableService :
111
109
genericContainerReq .Cmd = append (genericContainerReq .Cmd , "--tableHost" , "0.0.0.0" )
112
110
waitingFor = append (waitingFor , wait .ForListeningPort (TablePort ))
113
- waitingFor = append (waitingFor , wait .ForLog ("Table service is successfully listening" ))
114
111
}
115
112
}
116
113
117
- if len (waitingFor ) > 0 {
118
- genericContainerReq .WaitingFor = wait .ForAll (waitingFor ... )
119
- }
114
+ genericContainerReq .WaitingFor = wait .ForAll (genericContainerReq .WaitingFor , wait .ForAll (waitingFor ... ))
120
115
}
121
116
122
117
container , err := testcontainers .GenericContainer (ctx , genericContainerReq )
0 commit comments