Skip to content
This repository has been archived by the owner on Feb 27, 2023. It is now read-only.

Commit

Permalink
Add timeout
Browse files Browse the repository at this point in the history
  • Loading branch information
duck8823 committed Nov 28, 2018
1 parent 3fd0d1d commit 56542ff
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion application/service/runner/task_runner_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
"os"
"path"
"testing"
"time"
)

func TestDockerTaskRunner_Run(t *testing.T) {
Expand Down Expand Up @@ -45,8 +46,12 @@ func TestDockerTaskRunner_Run(t *testing.T) {
Docker: mockDocker,
}

// and
ctx, cancel := context.WithTimeout(context.Background(), 30*time.Second)
defer cancel()

// when
err := sut.Run(context.Background(), dir, runner.RunOptions{})
err := sut.Run(ctx, dir, runner.RunOptions{})

// then
if err != nil {
Expand Down

0 comments on commit 56542ff

Please sign in to comment.