1
0
Эх сурвалжийг харах

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

Put 40 seconds for timeout instead of 20
Djordje Lukic 5 жил өмнө
parent
commit
4286458300

+ 1 - 1
cli/main.go

@@ -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

+ 1 - 1
cli/mobycli/exec.go

@@ -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() {

+ 1 - 1
tests/e2e/e2e_test.go

@@ -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!"})
 	})