fn: tests for hung and bad docker repo during docker-pull (#1298)

* fn: tests for hung and bad docker repo during docker-pull
This commit is contained in:
Tolga Ceylan
2018-11-05 16:01:42 -08:00
committed by GitHub
parent 9b50eaddf1
commit 975b780695
7 changed files with 131 additions and 7 deletions

View File

@@ -80,7 +80,7 @@ func NewDocker(conf drivers.Config) *DockerDriver {
driver := &DockerDriver{
cancel: cancel,
conf: conf,
docker: newClient(ctx),
docker: newClient(ctx, conf.MaxRetries),
hostname: hostname,
auths: auths,
}
@@ -275,6 +275,11 @@ func (drv *DockerDriver) PrepareCookie(ctx context.Context, c drivers.Cookie) er
return err
}
// here let's assume we have created container, logically this should be after 'CreateContainer', but we
// are not 100% sure that *any* failure to CreateContainer does not ever leave a container around especially
// going through fsouza+docker-api.
cookie.isCreated = true
cookie.opts.Context = ctx
_, err = drv.docker.CreateContainer(cookie.opts)
if err != nil {