Fix error on pull hang in CI
Kill the underlying containerd after outputting error. Otherwise CI hangs indefinitely and requires the CI infrastructure to kill the build at the timeout expiration. Signed-off-by: Wei Fu <fuweid89@gmail.com> Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com>
This commit is contained in:
parent
6bcf463b01
commit
a4942ca4fe
@ -129,10 +129,11 @@ func TestMain(m *testing.M) {
|
|||||||
}).Info("running tests against containerd")
|
}).Info("running tests against containerd")
|
||||||
|
|
||||||
// pull a seed image
|
// pull a seed image
|
||||||
|
log.G(ctx).Info("start to pull seed image")
|
||||||
if _, err = client.Pull(ctx, testImage, WithPullUnpack); err != nil {
|
if _, err = client.Pull(ctx, testImage, WithPullUnpack); err != nil {
|
||||||
ctrd.Stop()
|
|
||||||
ctrd.Wait()
|
|
||||||
fmt.Fprintf(os.Stderr, "%s: %s\n", err, buf.String())
|
fmt.Fprintf(os.Stderr, "%s: %s\n", err, buf.String())
|
||||||
|
ctrd.Kill()
|
||||||
|
ctrd.Wait()
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user