def METHOD_NAME(action_obj, sagemaker_session):
    tag = {"Key": "foo", "Value": "bar"}
    action_obj.set_tag(tag)
    while True:
        actual_tags = sagemaker_session.sagemaker_client.list_tags(
            ResourceArn=action_obj.action_arn
        )["Tags"]
        if actual_tags:
            break
        time.sleep(5)
    # When sagemaker-client-config endpoint-url is passed as argument to hit some endpoints,
    # length of actual tags will be greater than 1
    assert len(actual_tags) > 0
    assert actual_tags[0] == tag