diff --git a/internal/taskrunner/taskrunner.go b/internal/taskrunner/taskrunner.go index b5b5c726f9..78a0b66dd7 100644 --- a/internal/taskrunner/taskrunner.go +++ b/internal/taskrunner/taskrunner.go @@ -160,5 +160,8 @@ func (tr *TaskRunner) emptyForCancel() { // or the parent context to have been canceled. func (tr *TaskRunner) Wait() error { tr.wg.Wait() + + tr.lock.Lock() + defer tr.lock.Unlock() return tr.err }