From 45ad064150940a7e54316620d9716443bdaaf0ab Mon Sep 17 00:00:00 2001 From: Alexander Morozov Date: Tue, 31 Mar 2015 15:12:15 -0700 Subject: [PATCH] Fix panic in integration tests Closing activationLock only if it's not closed already. This is needed only because integration tests using docker code directly and doesn't care about global state. Signed-off-by: Alexander Morozov (cherry picked from commit c71747571458bf992c729c483c9509e8182d630b) Docker-DCO-1.1-Signed-off-by: Jessie Frazelle (github: jfrazelle) Docker-DCO-1.1-Signed-off-by: Jessie Frazelle (github: jfrazelle) --- api/server/server_linux.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/api/server/server_linux.go b/api/server/server_linux.go index fff803dda..a9311573d 100644 --- a/api/server/server_linux.go +++ b/api/server/server_linux.go @@ -95,7 +95,9 @@ func AcceptConnections(job *engine.Job) engine.Status { go systemd.SdNotify("READY=1") // close the lock so the listeners start accepting connections - if activationLock != nil { + select { + case <-activationLock: + default: close(activationLock) }