diff --git a/runnable-mail_test.go b/runnable-mail_test.go index ea5c911f1fe512f82ae3616660699155edebd682..8fbc22a07a7ee6e3b25321b9d77e378ad9b17ab7 100644 --- a/runnable-mail_test.go +++ b/runnable-mail_test.go @@ -69,7 +69,7 @@ func startTestSMTPDockerImageAndContainer(t *testing.T, host string, port string Timeout: &timeout, Signal: "SIGKILL", } - newCtx, _ := context.WithTimeout(context.Background(), 20*time.Second) + newCtx, _ := context.WithTimeout(context.Background(), 60*time.Second) if err := cli.ContainerStop(newCtx, resp.ID, stopOptions); err != nil { t.Errorf("ContainerStop returned error: %v", err) } @@ -107,7 +107,7 @@ func TestMailRunner(t *testing.T) { time.Sleep(1 * time.Second) }) - host := "0.0.0.0" + host := "172.17.0.1" listener, err := net.Listen("tcp", host+":0") if err != nil { @@ -128,7 +128,7 @@ func TestMailRunner(t *testing.T) { done <- true }() - waitCtx, waitCancel := context.WithTimeout(ctx, 30*time.Second) + waitCtx, waitCancel := context.WithTimeout(ctx, 60*time.Second) defer waitCancel() for { conn, err := net.DialTimeout("tcp", net.JoinHostPort(host, portAsString), 1*time.Second) diff --git a/runnable-sftp_test.go b/runnable-sftp_test.go index f825b340a4783aa9cf37589c73ed663fd17af0ff..cfca7efee2205a9ddb7ca773bccf87040988a624 100644 --- a/runnable-sftp_test.go +++ b/runnable-sftp_test.go @@ -8,7 +8,6 @@ import ( "github.com/docker/docker/client" "github.com/docker/go-connections/nat" "github.com/stretchr/testify/assert" - "io" "net" "os" "testing" @@ -31,7 +30,7 @@ func startSFTPTestDockerImageAndContainer(t *testing.T, host string, port string } //if debug image pull, comment out the following lines - _, _ = io.Copy(os.Stdout, reader) + //_, _ = io.Copy(os.Stdout, reader) _ = reader hostConfig := &container.HostConfig{ @@ -70,7 +69,7 @@ func startSFTPTestDockerImageAndContainer(t *testing.T, host string, port string Timeout: &timeout, Signal: "SIGKILL", } - newCtx, _ := context.WithTimeout(context.Background(), 20*time.Second) + newCtx, _ := context.WithTimeout(context.Background(), 60*time.Second) if err := cli.ContainerStop(newCtx, resp.ID, stopOptions); err != nil { t.Errorf("ContainerStop returned error: %v", err) } @@ -108,7 +107,7 @@ func TestSFTPCRunnerLocalToRemote(t *testing.T) { time.Sleep(1 * time.Second) }) - host := "0.0.0.0" + host := "172.17.0.1" listener, err := net.Listen("tcp", host+":0") if err != nil { @@ -129,7 +128,7 @@ func TestSFTPCRunnerLocalToRemote(t *testing.T) { done <- true }() - waitCtx, waitCancel := context.WithTimeout(ctx, 30*time.Second) + waitCtx, waitCancel := context.WithTimeout(ctx, 60*time.Second) defer waitCancel() for { conn, err := net.DialTimeout("tcp", net.JoinHostPort(host, portAsString), 1*time.Second) @@ -234,7 +233,7 @@ func TestSFTPCRunnerRemoteToLocal(t *testing.T) { done <- true }() - waitCtx, waitCancel := context.WithTimeout(ctx, 30*time.Second) + waitCtx, waitCancel := context.WithTimeout(ctx, 60*time.Second) defer waitCancel() for { conn, err := net.DialTimeout("tcp", net.JoinHostPort(host, portAsString), 1*time.Second)