 func runTest(useSSL: Bool) {
   gRPC.initialize()
 
-  let serverRunningSemaphore = DispatchSemaphore(value: 0)
+  var serverRunningSemaphore: DispatchSemaphore?
 
   // create the server
   let server: Server

  _ = sem.wait()
}

func runServer(server: Server) throws {
  var requestCount = 0
  let sem = DispatchSemaphore(value: 0)
  server.run { requestHandler in

  verify_metadata(initialMetadata, expected: initialClientMetadata)

  let initialMetadataToSend = Metadata(initialServerMetadata)
  let sendMetadataSem = DispatchSemaphore(value: 0)
  try requestHandler.sendMetadata(initialMetadata: initialMetadataToSend) { _ in
    _ = sendMetadataSem.signal()
  }
  _ = sendMetadataSem.wait()
  
  // Receive remaining pings
  for _ in 0..<steps {
    let receiveSem = DispatchSemaphore(value: 0)
    try requestHandler.receiveMessage(completion: { callStatus in
      let messageString = String(data: callStatus.resultData!, encoding: .utf8)
