def METHOD_NAME(self, with_error):
    """Runs and tests server and client in parallel."""
    server_flags = ["--file=" + file, "--done_file=" + done_file]
    client_flags = ["--file=" + file]
    if with_error:
        server_flags += ["--with_error"]
        client_flags += ["--stop_on_error"]
    with scoped_file(file, is_fifo=True), scoped_file(done_file):
        with open(done_file, 'w') as f:
            f.write("0\n")
        # Start client.
        client = subprocess.Popen([client_bin] + client_flags)
        # Start server.
        server = subprocess.Popen([server_bin] + server_flags)
        # Join with processes, check return codes.
        server_valid_statuses = [0]
        if with_error:
            # If the C++ binary has not finished by the time the Python
            # client exits due to failure, then the C++ binary will fail
            # with SIGPIPE.
            server_valid_statuses.append(SIGPIPE_STATUS)
        self.assertIn(server.wait(), server_valid_statuses)
        if not with_error:
            # Execute once more.
            server = subprocess.Popen([server_bin] + server_flags)
            self.assertIn(server.wait(), server_valid_statuses)
            # Wait until the client has indicated that the server process
            # has run twice. We want to run twice to ensure that looping on
            # the client end runs correctly.
            wait_for_done_count(2)
            client.send_signal(signal.SIGINT)
        client_status = client.wait()
        self.assertEqual(client_status, int(with_error))