def _auth0_await_user(testapp, user_uuid):
    """
    Wait (for a reasonable time) for a given user's uuid to appear in a /users/ response.

    This function will retry at half-second intervals until the query doesn't fail
    or the retry conditions are exceeded.
    """
    url = "/users/%s" + user_uuid
    response = testapp.get('/users/')
    assert response.status_code == 200, "Expected %s to exist." % url
    assert any(user['uuid'] == user_uuid for user in response.json['@graph'])
    return response