fix: use custom timeout error if the runner times out

This commit is contained in:
Juan Pablo Villafáñez
2024-04-22 12:51:25 +02:00
parent 0d5756bc53
commit 08c47632f0
3 changed files with 37 additions and 3 deletions
+1 -2
View File
@@ -2,7 +2,6 @@ package runner
import (
"context"
"fmt"
"sync/atomic"
"time"
)
@@ -188,7 +187,7 @@ func (r *Runner) doTask(ch chan<- *Result, closeChan bool) {
case d := <-r.interruptedCh:
result = &Result{
RunnerID: r.ID,
RunnerError: fmt.Errorf("runner %s timed out after waiting for %s", r.ID, d.String()),
RunnerError: NewTimeoutError(r.ID, d),
}
case result = <-tmpCh:
// Just assign the received value, nothing else to do