Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions pipeliner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -76,10 +76,15 @@ func testPipeliner(doError bool, doCancel bool) ([]int, error) {
for i := range v {
err := pipeliner.WaitForRoom(ctx)
if err != nil {
// Ensure any in-flight goroutines are complete before returning. Note that Flush does not actually wait if there is an error.
for pipeliner.hasOutstanding() {
<-pipeliner.ch
}
return v, err
}
go func(i int) { pipeliner.CompleteOne(f(ctx, i)) }(i)
}

err := pipeliner.Flush(ctx)
return v, err
}
Loading