Merge pull request #471 from docker/fix-run-timeout

Put 40 seconds for timeout instead of 20
This commit is contained in:
Djordje Lukic 2020-08-13 10:44:37 +02:00 committed by GitHub
commit 4286458300
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 3 deletions

View File

@ -226,7 +226,7 @@ func checkIfUnknownCommandExistInDefaultContext(err error, currentContext string
func newSigContext() (context.Context, func()) {
ctx, cancel := context.WithCancel(context.Background())
s := make(chan os.Signal)
s := make(chan os.Signal, 1)
signal.Notify(s, syscall.SIGTERM, syscall.SIGINT)
go func() {
<-s

View File

@ -62,7 +62,7 @@ func Exec() {
cmd.Stdout = os.Stdout
cmd.Stderr = os.Stderr
signals := make(chan os.Signal)
signals := make(chan os.Signal, 1)
childExit := make(chan bool)
signal.Notify(signals) // catch all signals
go func() {

View File

@ -299,7 +299,7 @@ func TestLegacy(t *testing.T) {
t.Run("local run", func(t *testing.T) {
t.Parallel()
cmd := c.NewDockerCmd("run", "--rm", "hello-world")
cmd.Timeout = 20 * time.Second
cmd.Timeout = 40 * time.Second
res := icmd.RunCmd(cmd)
res.Assert(t, icmd.Expected{Out: "Hello from Docker!"})
})