Jelajahi Sumber

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 tahun lalu
induk
melakukan
c717475714
1 mengubah file dengan 3 tambahan dan 1 penghapusan
  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")
 
 	// close the lock so the listeners start accepting connections
-	if activationLock != nil {
+	select {
+	case <-activationLock:
+	default:
 		close(activationLock)
 	}