Skip to content

Commit d169881

Browse files
Fix function which waits for starter readiness
1 parent 0d84759 commit d169881

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

test/util.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -189,29 +189,29 @@ func WaitUntilStarterExit(t *testing.T, timeout time.Duration, exitCode int, sta
189189

190190
// WaitUntilStarterReady waits until all given starter processes have reached the "Your cluster is ready state"
191191
func WaitUntilStarterReady(t *testing.T, what string, requiredGoodResults int, starters ...*SubProcess) bool {
192-
results := make([]error, len(starters))
192+
errors := make([]error, len(starters))
193193

194194
ctx, cancel := context.WithCancel(context.Background())
195195
defer cancel()
196196

197197
var wg sync.WaitGroup
198198

199-
wg.Add(len(results))
199+
wg.Add(len(errors))
200200

201201
for id, starter := range starters {
202202
go func(i int, s *SubProcess) {
203203
defer wg.Done()
204-
defer cancel()
204+
205205
id := fmt.Sprintf("starter-%d", i+1)
206206

207-
results[i] = s.ExpectTimeout(ctx, time.Minute*3, regexp.MustCompile(fmt.Sprintf("Your %s can now be accessed with a browser at", what)), id)
207+
errors[i] = s.ExpectTimeout(ctx, time.Minute*1, regexp.MustCompile(fmt.Sprintf("Your %s can now be accessed with a browser at", what)), id)
208208
}(id, starter)
209209
}
210210

211211
wg.Wait()
212212

213213
failed := 0
214-
for _, result := range results {
214+
for _, result := range errors {
215215
if result != nil {
216216
failed++
217217
}
@@ -229,7 +229,7 @@ func WaitUntilStarterReady(t *testing.T, what string, requiredGoodResults int, s
229229
time.Sleep(time.Hour)
230230
}
231231
}
232-
for _, msg := range results {
232+
for _, msg := range errors {
233233
t.Error(msg)
234234
}
235235

0 commit comments

Comments
 (0)