'Starts a test server, returns the (pid, port) pair.
The server needs to be in a subprocess because we need to run a
TThreadedServer for the concurrency tests. And the only way to stop a
TThreadedServer is to kill it. So we can\'t just use a thread.'

def start_server_process(self):

    self.pid = os.fork()
    if (self.pid != 0):
        logging.info(('Started    SimpleThriftServer    (pid    %s)    on    port    %s' % (self.pid, self.port)))
        self._ensure_online()
        return
    try:
        processor = TestService.Processor(self)
        transport = TSocket.TServerSocket('localhost', self.port, socket_family=self.socket_family)
        server = TServer.TThreadedServer(processor, transport, TBufferedTransportFactory(), TBinaryProtocolFactory())
        server.serve()
    except:
        LOG.exception('failed    to    start    thrift    server')
        sys.exit(1)
