def get_timeout_error_regex(rpc_backend_name):
    """
    Given an RPC backend name, returns a partial string indicating the error we
    should receive when an RPC has timed out. Useful for use with
    assertRaisesRegex() to ensure we have the right errors during timeout.
    """
    if rpc_backend_name in ["PROCESS_GROUP", "FAULTY_PROCESS_GROUP", "TENSORPIPE"]:
        return "RPC ran for more than"
    else:
        return "(Timed out)|(Task expired)"