Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Entity creation fails if the _profile is an empty list #40

Open
itomaldonado opened this issue Sep 13, 2017 · 0 comments
Open

Entity creation fails if the _profile is an empty list #40

itomaldonado opened this issue Sep 13, 2017 · 0 comments

Comments

@itomaldonado
Copy link
Contributor

As per our (AM, MM and MT) conversation on 9/12, an entity could have an empty profile, in other words a list with no events (not a None type but a list()).

But as per testing, this actually fails with an assertion error. See below:

___________________________________________________________________________ TestEntity.test_empty_profile ___________________________________________________________________________

self = <tests.test_entity.TestEntity object at 0x106eb7490>
pilot_entity = {'details': {'cfg': {'agent_launch_method': 'FORK', 'bridges': {'agent_executing_queue': {'bulk_size': 0, 'log_level':...893951416, 'state', 'pmgr.0000', 'MainThread', 'pilot.0000', 'PMGR_LAUNCHING_PENDING', ...), ...], 'uid': 'pilot.0000'}

    def test_empty_profile(self, pilot_entity):
        e = Entity(_uid=pilot_entity['uid'],
                   _etype=pilot_entity['etype'],
                   _profile=[],
>                  _details=pilot_entity['details']
                   )

tests/test_entity.py:158: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <[AttributeError("'Entity' object has no attribute '_etype'") raised in repr()] SafeRepr object at 0x106e97170>, _uid = 'pilot.0000', _etype = 'pilot', _profile = []
_details = {'cfg': {'agent_launch_method': 'FORK', 'bridges': {'agent_executing_queue': {'bulk_size': 0, 'log_level': 'debug', 's...scription': {'access_schema': None, 'candidate_hosts': None, 'cleanup': None, 'cores': 32, ...}, 'etype': 'pilot', ...}

    def __init__(self, _uid, _etype, _profile, _details):
        """
            This is a private constructor for an RA Entity: it gets a series of
            events and sorts it into its properties.  We have 4 properties:
    
              - etype : the type of the entity in question.  This defines, amongst
                        others, what state model the Session will assume to be valid
                        for this entity
              - uid   : an ID assumed to be unique in the scope of an RA Session
              - states: a set of timed state transitions which are assumed to adhere
                        to a well defined state model
              - events: a time series of named, but otherwise unspecified events
            """
    
        assert(_uid)
>       assert(_profile)
E       AssertionError

venv/lib/python2.7/site-packages/radical/analytics/entity.py:27: AssertionError
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant