def METHOD_NAME(sock, n):
    """Read n bytes from the socket, abort on test case timeout"""
    remaining_bytes = n
    response = bytearray()
    while remaining_bytes > 0:
        abort_on_timeout()
        response += sock.recv(remaining_bytes)
        remaining_bytes = n - len(response)
    return response