keepAliveProducerReconnects :: Spec
keepAliveProducerReconnects = it "reconnects after the socket is closed" $ do
      let stream = Stream (Topic "keep_alive_producer_reconnects_to_closed_sockets") (Partition 0)
          message = Message "keep_alive_producer_should_receive_this_after_closing_socket"
          (testProducer, testConsumer) = coupledProducerConsumer stream
      result <- newEmptyMVar
      p <- keepAliveProducer testProducer

      killSocket' p

      recordMatching testConsumer message result
      produce p [message]

      waitFor result message (killSocket' p)
keepAliveProducerReconnects :: Spec
keepAliveProducerReconnects = it "reconnects after the socket is closed" $ do
      let stream = Stream (Topic "keep_alive_producer_reconnects_to_closed_sockets") (Partition 0)
          message = Message "keep_alive_producer_should_receive_this_after_closing_socket"
          (testProducer, testConsumer) = coupledProducerConsumer stream
      result <- newEmptyMVar
      p <- keepAliveProducer testProducer

      killSocket' p

      recordMatching testConsumer message result
      produce p [message]

      waitFor result message (killSocket' p)
keepAliveProducerReconnects = it "reconnects after the socket is closed" $ do
      let stream = Stream (Topic "keep_alive_producer_reconnects_to_closed_sockets") (Partition 0)
          message = Message "keep_alive_producer_should_receive_this_after_closing_socket"
          (testProducer, testConsumer) = coupledProducerConsumer stream
      result <- newEmptyMVar
      p <- keepAliveProducer testProducer

      killSocket' p

      recordMatching testConsumer message result
      produce p [message]

      waitFor result message (killSocket' p)