We are using SCOOP in a larger project, and are attempting to write unit tests for our code. We adopted the unit test structure from what is provided in the test/tests.py module, particularly, we are subclassing the TestScoopCommon class.
Unfortunately, when running our tests we run into trouble. In fact, the same error messages appear when running the unit tests located in the test folder of the scoop repository via:
clear;nosetests --verbose --nologcapture --nocapture test/tests.py
The behavior is non-deterministic, as far as I can tell. The unit tests sometimes run, sometimes they hang.
Error messages are diverse:
Either:
Traceback (most recent call last):
File "/usr/lib/python2.7/threading.py", line 551, in __bootstrap_inner
self.run()
File "/usr/lib/python2.7/threading.py", line 504, in run
self.__target(*self.__args, **self.__kwargs)
File "/vagrant_data/Code/scoop/scoop/_comm/scoopzmq.py", line 196, in _reportFutures
pickle.dumps(fids),
File "/home/vagrant/venv/local/lib/python2.7/site-packages/zmq/sugar/socket.py", line 329, in send_multipart
self.send(msg, SNDMORE|flags, copy=copy, track=track)
File "zmq/backend/cython/socket.pyx", line 617, in zmq.backend.cython.socket.Socket.send (zmq/backend/cython/socket.c:6625)
File "zmq/backend/cython/socket.pyx", line 654, in zmq.backend.cython.socket.Socket.send (zmq/backend/cython/socket.c:6271)
File "zmq/backend/cython/socket.pyx", line 94, in zmq.backend.cython.socket._check_closed (zmq/backend/cython/socket.c:1328)
ZMQError: Socket operation on non-socket
Either:
test_wait_with_timeout (tests.TestApi) ... Traceback (most recent call last):
File "/usr/lib/python2.7/runpy.py", line 162, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "/usr/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/vagrant_data/Code/scoop/scoop/broker/__main__.py", line 84, in <module>
headless=args.headless,
File "scoop/broker/brokerzmq.py", line 85, in __init__
self.task_socket.bind(tSock)
File "zmq/backend/cython/socket.pyx", line 487, in zmq.backend.cython.socket.Socket.bind (zmq/backend/cython/socket.c:5156)
File "zmq/backend/cython/checkrc.pxd", line 25, in zmq.backend.cython.checkrc._check_rc (zmq/backend/cython/socket.c:7535)
zmq.error.ZMQError: Address already in use
ok
When aborting via CTRL-C the following error messages would sometimes appear, the following lines would sometimes appear:
raise Exception('Could not start server!')
Exception: Could not start server!
Is it possible that the tear down steps in TestScoopCommon do not fully clean up everything, e.g. releasing ports etc...
We are running SCOOP from within a linux VM, using ZMQ v15.2.0.
Thanks!