diff --git a/validation/pidfile/pidfile.go b/validation/pidfile/pidfile.go index 45adfbca..598f3e2c 100644 --- a/validation/pidfile/pidfile.go +++ b/validation/pidfile/pidfile.go @@ -56,11 +56,10 @@ func main() { return nil }, PreDelete: func(r *util.Runtime) error { - util.WaitingForStatus(*r, util.LifecycleStatusRunning, time.Second*10, time.Second*1) - err = r.Kill("KILL") - // wait before the container been deleted - util.WaitingForStatus(*r, util.LifecycleStatusStopped, time.Second*10, time.Second*1) - return err + // The container process is `true`, so it exits on its own and + // signalling it afterwards is an error the runtime is required + // to generate. + return util.WaitingForStatus(*r, util.LifecycleStatusStopped, time.Second*10, time.Second*1) }, } diff --git a/validation/start/start.go b/validation/start/start.go index 07895d8e..656cb02c 100644 --- a/validation/start/start.go +++ b/validation/start/start.go @@ -109,12 +109,10 @@ func main() { } err = r.Start() - util.SpecErrorOK(t, err == nil, specerror.NewError(specerror.StartWithProcUnsetGenError, fmt.Errorf("`start` operation MUST generate an error if `process` was not set"), rspecs.Version), err) - err = util.WaitingForStatus(r, util.LifecycleStatusStopped, time.Second*10, time.Second*1) - if err == nil { - err = r.Delete() - } - if err != nil { - t.Fail(err.Error()) - } + util.SpecErrorOK(t, err != nil, specerror.NewError(specerror.StartWithProcUnsetGenError, fmt.Errorf("`start` operation MUST generate an error if `process` was not set"), rspecs.Version), err) + + // The container never ran, and nothing in the spec says how to dispose + // of one that has no `process` to signal, so tear it down without + // holding the runtime to a particular way out. + r.Clean() }