Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions validation/pidfile/pidfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
},
}

Expand Down
14 changes: 6 additions & 8 deletions validation/start/start.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
Loading