mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
Check WaitTimeout return in test, replaced lock initialization in runtime.Register() with call to initLock()
This commit is contained in:
parent
d1767bbf67
commit
ad0183e419
2 changed files with 4 additions and 5 deletions
|
@ -11,7 +11,6 @@ import (
|
|||
"path"
|
||||
"sort"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
)
|
||||
|
||||
|
@ -154,9 +153,7 @@ func (runtime *Runtime) Register(container *Container) error {
|
|||
|
||||
container.runtime = runtime
|
||||
// Setup state lock (formerly in newState()
|
||||
lock := new(sync.Mutex)
|
||||
container.State.stateChangeLock = lock
|
||||
container.State.stateChangeCond = sync.NewCond(lock)
|
||||
container.State.initLock()
|
||||
// Attach to stdout and stderr
|
||||
container.stderr = newWriteBroadcaster()
|
||||
container.stdout = newWriteBroadcaster()
|
||||
|
|
|
@ -305,7 +305,9 @@ func TestRestore(t *testing.T) {
|
|||
// Simulate a crash/manual quit of dockerd: process dies, states stays 'Running'
|
||||
cStdin, _ := container2.StdinPipe()
|
||||
cStdin.Close()
|
||||
container2.WaitTimeout(time.Second)
|
||||
if err := container2.WaitTimeout(time.Second); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
container2.State.Running = true
|
||||
container2.ToDisk()
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue