z25 / pyZOCP

Python ZOCP implementation (Z25 Orchestration Control Protocol)
GNU Lesser General Public License v3.0
33 stars 5 forks source link

Capability refactor #53

Open sphaero opened 9 years ago

sphaero commented 9 years ago

Implemented a ZOCPParameter class with necessary functionality. It tracks a list of parameters by itself including the id's. unittests are ok (hopefully travis as well). It still needs work on the signals!

sphaero commented 9 years ago

Ow btw a discussion was at #42

sphaero commented 9 years ago

The travis fail was because of https://github.com/zeromq/pyre/pull/48 No idea why it only showed up on python 3.2???

sphaero commented 9 years ago

Been testing with the node editor. Actually got quite far :) Nodes show up in the editor and I can manage subscriptions. However editing from the urwid monitor:

Traceback (most recent call last):
  File "signal_subscriber.py", line 34, in <module>
    z.run()
  File "signal_subscriber.py", line 20, in run
    super().run()
  File "/home/arnaud/src/pyZOCP/src/zocp.py", line 799, in run
    self.get_message()
  File "/home/arnaud/src/pyZOCP/src/zocp.py", line 612, in get_message
    self._handle_SET(msg[method], peer, name, grp)
  File "/home/arnaud/src/pyZOCP/src/zocp.py", line 652, in _handle_SET
    self._on_modified(data, peer, name)
  File "/home/arnaud/src/pyZOCP/src/zocp.py", line 751, in _on_modified
    for subscriber in self.subscribers:
AttributeError: 'SubscriberNode' object has no attribute 'subscribers'

subscribee doesn't show up in urwid.

sphaero commented 9 years ago

also an error in urwid on nodeeditor exit: line 571 in get_message subscribers doesn't exists. (can't copy paste)

sphaero commented 9 years ago

I don't understand why travis is failing:

WARNING:pyre.pyre_node:{}
WARNING:pyre.pyre_node:We don't know peer id 94d33670-0bbb-406e-aedc-e5ca55ff9ca7
WARNING:pyre.pyre_node:{}
WARNING:pyre.pyre_node:We don't know peer id 4847a7d3-116a-4584-9c10-7156105887d3

those are weird errors which I can' reproduce

sphaero commented 9 years ago

A combination of these tests gives an exception sometimes:

test_object_param
test_param
test_signal_monitor/test_signal_subscribe
test_emit_signal (test_zocp.ZOCPTest) ... skipped 'skip'
test_get_name (test_zocp.ZOCPTest) ... skipped 'skip'
test_get_own_groups (test_zocp.ZOCPTest) ... skipped 'skip'
test_get_peer_address (test_zocp.ZOCPTest) ... skipped 'skip'
test_get_peer_groups (test_zocp.ZOCPTest) ... skipped 'skip'
test_get_peer_header_value (test_zocp.ZOCPTest) ... skipped 'skip'
test_get_peers (test_zocp.ZOCPTest) ... skipped 'skip'
test_object_param (test_zocp.ZOCPTest) ... WARNING:root:can't set ROUTER_HANDOVER, needs zmq version >=4.1 but installed is 4.0.4
WARNING:root:can't set ROUTER_HANDOVER, needs zmq version >=4.1 but installed is 4.0.4
/usr/local/lib/python3.4/dist-packages/zmq/sugar/socket.py:89: DeprecationWarning: Socket.socket_type is deprecated, use Socket.type
  DeprecationWarning
ok
test_param (test_zocp.ZOCPTest) ... WARNING:root:can't set ROUTER_HANDOVER, needs zmq version >=4.1 but installed is 4.0.4
WARNING:root:can't set ROUTER_HANDOVER, needs zmq version >=4.1 but installed is 4.0.4
ok
test_signal_monitor (test_zocp.ZOCPTest) ... skipped 'skip'
test_signal_subscribe (test_zocp.ZOCPTest) ... WARNING:root:can't set ROUTER_HANDOVER, needs zmq version >=4.1 but installed is 4.0.4
WARNING:root:can't set ROUTER_HANDOVER, needs zmq version >=4.1 but installed is 4.0.4
Exception in thread Thread-9:
Traceback (most recent call last):
  File "/usr/lib/python3.4/threading.py", line 920, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.4/threading.py", line 868, in run
    self._target(*self._args, **self._kwargs)
  File "/home/people/arnaud/src/pyre/pyre/zactor.py", line 58, in run
    self.shim_handler(*self.shim_args, **self.shim_kwargs)
  File "/home/people/arnaud/src/pyre/pyre/pyre_node.py", line 52, in __init__
    self.run()
  File "/home/people/arnaud/src/pyre/pyre/pyre_node.py", line 480, in run
    items = dict(self.poller.poll(timeout * 1000))
  File "/usr/local/lib/python3.4/dist-packages/zmq/sugar/poll.py", line 101, in poll
    return zmq_poll(self.sockets, timeout=timeout)
  File "zmq/backend/cython/_poll.pyx", line 115, in zmq.backend.cython._poll.zmq_poll (zmq/backend/cython/_poll.c:1589)
  File "zmq/backend/cython/checkrc.pxd", line 21, in zmq.backend.cython.checkrc._check_rc (zmq/backend/cython/_poll.c:2019)
zmq.error.ZMQError: Socket operation on non-socket

Upgraded zmq to 4.1 and now running without trouble.... weird. Might cause travis build fail as well

sphaero commented 9 years ago

After a long run I still got an error:

======================================================================
ERROR: test_param (test_zocp.ZOCPTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/people/arnaud/src/pyZOCP/tests/test_zocp.py", line 26, in tearDown
    self.node1.stop()
  File "/home/people/arnaud/src/pyre/pyre/pyre.py", line 95, in stop
    self.actor.resolve().wait()
  File "/home/people/arnaud/src/pyre/pyre/zsocket.py", line 36, in wait
    msg = self.recv()
  File "zmq/backend/cython/socket.pyx", line 631, in zmq.backend.cython.socket.Socket.recv (zmq/backend/cython/socket.c:5775)
  File "zmq/backend/cython/socket.pyx", line 665, in zmq.backend.cython.socket.Socket.recv (zmq/backend/cython/socket.c:5575)
  File "zmq/backend/cython/socket.pyx", line 139, in zmq.backend.cython.socket._recv_copy (zmq/backend/cython/socket.c:1728)
  File "zmq/backend/cython/checkrc.pxd", line 15, in zmq.backend.cython.checkrc._check_rc (zmq/backend/cython/socket.c:6115)
zmq.error.Again: Resource temporarily unavailable

seems the frontend is waiting for the backend to signal stop however either the frontend or the backend is already gone