浏览代码

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 <lk4d4@docker.com>
Alexander Morozov 10 年之前
父节点
当前提交
c717475714
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      api/server/server_linux.go

+ 3 - 1
api/server/server_linux.go

@@ -95,7 +95,9 @@ func AcceptConnections(job *engine.Job) error {
 	go systemd.SdNotify("READY=1")
 	go systemd.SdNotify("READY=1")
 
 
 	// close the lock so the listeners start accepting connections
 	// close the lock so the listeners start accepting connections
-	if activationLock != nil {
+	select {
+	case <-activationLock:
+	default:
 		close(activationLock)
 		close(activationLock)
 	}
 	}