tikan / rmock

GNU Lesser General Public License v3.0
2 stars 2 forks source link

TestRmockStartStopServer.test_server_already_running fails most of the time #1

Open amgaera opened 11 years ago

amgaera commented 11 years ago

On my VM (VirtualBox 4.2.16 with Ubuntu 12.04.2) TestRmockStartStopServer.test_server_already_running fails most of the time with the following output:

......Exception AssertionError: AssertionError('can only test a child process',) in <Finalize object, dead> ignored
.Exception AssertionError: AssertionError('can only test a child process',) in <Finalize object, dead> ignored
...Exception AssertionError: AssertionError('can only test a child process',) in <Finalize object, dead> ignored
..Process Process-22:
Traceback (most recent call last):
  File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap
    self.run()
  File "/usr/lib/python2.7/multiprocessing/process.py", line 114, in run
    self._target(*self._args, **self._kwargs)
  File "/media/sf_sgp/rmock/tests/func_tests/../../src/rmock/core/mock.py", line 150, in _run_mock_process
    self._runner.run(self._rmock_data)
  File "/media/sf_sgp/rmock/tests/func_tests/../../src/rmock/runners/http/runner.py", line 126, in run
    self._run_tornado_server(application)
  File "/media/sf_sgp/rmock/tests/func_tests/../../src/rmock/runners/http/runner.py", line 130, in _run_tornado_server
    http_server.bind(self.port)
  File "/home/amgaera/default/local/lib/python2.7/site-packages/tornado/tcpserver.py", line 162, in bind
    backlog=backlog)
  File "/home/amgaera/default/local/lib/python2.7/site-packages/tornado/netutil.py", line 90, in bind_sockets
    sock.bind(sockaddr)
  File "/usr/lib/python2.7/socket.py", line 224, in meth
    return getattr(self._sock,name)(*args)
error: [Errno 98] Address already in use
.Exception AssertionError: AssertionError('can only test a child process',) in <Finalize object, dead> ignored
....Exception AssertionError: AssertionError('can only test a child process',) in <Finalize object, dead> ignored
.Exception AssertionError: AssertionError('can only test a child process',) in <Finalize object, dead> ignored
Process Process-33:
Traceback (most recent call last):
  File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap
    self.run()
  File "/usr/lib/python2.7/multiprocessing/process.py", line 114, in run
    self._target(*self._args, **self._kwargs)
  File "/media/sf_sgp/rmock/tests/func_tests/../../src/rmock/core/mock.py", line 150, in _run_mock_process
    self._runner.run(self._rmock_data)
  File "/media/sf_sgp/rmock/tests/func_tests/../../src/rmock/runners/http/runner.py", line 126, in run
    self._run_tornado_server(application)
  File "/media/sf_sgp/rmock/tests/func_tests/../../src/rmock/runners/http/runner.py", line 130, in _run_tornado_server
    http_server.bind(self.port)
  File "/home/amgaera/default/local/lib/python2.7/site-packages/tornado/tcpserver.py", line 162, in bind
    backlog=backlog)
  File "/home/amgaera/default/local/lib/python2.7/site-packages/tornado/netutil.py", line 67, in bind_sockets
    0, flags)):
gaierror: [Errno -8] Servname not supported for ai_socktype
..........Exception AssertionError: AssertionError('can only test a child process',) in <Finalize object, dead> ignored
......Exception AssertionError: AssertionError('can only test a child process',) in <Finalize object, dead> ignored
.Exception AssertionError: AssertionError('can only test a child process',) in <Finalize object, dead> ignored
.....Exception AssertionError: AssertionError('can only test a child process',) in <Finalize object, dead> ignored
.....Exception AssertionError: AssertionError('can only test a child process',) in <Finalize object, dead> ignored
...Exception AssertionError: AssertionError('can only test a child process',) in <Finalize object, dead> ignored
...Exception AssertionError: AssertionError('can only test a child process',) in <Finalize object, dead> ignored
.Exception AssertionError: AssertionError('can only test a child process',) in <Finalize object, dead> ignored
.Exception AssertionError: AssertionError('can only test a child process',) in <Finalize object, dead> ignored
.Exception AssertionError: AssertionError('can only test a child process',) in <Finalize object, dead> ignored
.Exception AssertionError: AssertionError('can only test a child process',) in <Finalize object, dead> ignored
.Exception AssertionError: AssertionError('can only test a child process',) in <Finalize object, dead> ignored
.............F
======================================================================
FAIL: test_start_stop_server.TestRmockStartStopServer.test_server_already_running
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/amgaera/default/local/lib/python2.7/site-packages/nose/case.py", line 197, in runTest
    self.test(*self.arg)
  File "/media/sf_sgp/rmock/tests/func_tests/test_start_stop_server.py", line 50, in test_server_already_running
    port=port
AssertionError: RmockError not raised
-------------------- >> begin captured logging << --------------------
rmock.core: DEBUG: terminating process 14988
--------------------- >> end captured logging << ---------------------

----------------------------------------------------------------------
Ran 70 tests in 12.792s

FAILED (failures=1)
Process Process-131:
Traceback (most recent call last):
  File "/usr/lib/python2.7/multiprocessing/process.py", line 258, in _bootstrap
    self.run()
  File "/usr/lib/python2.7/multiprocessing/process.py", line 114, in run
    self._target(*self._args, **self._kwargs)
  File "/media/sf_sgp/rmock/tests/func_tests/../../src/rmock/core/mock.py", line 150, in _run_mock_process
    self._runner.run(self._rmock_data)
  File "/media/sf_sgp/rmock/tests/func_tests/../../src/rmock/runners/http/runner.py", line 126, in run
    self._run_tornado_server(application)
  File "/media/sf_sgp/rmock/tests/func_tests/../../src/rmock/runners/http/runner.py", line 130, in _run_tornado_server
    http_server.bind(self.port)
  File "/home/amgaera/default/local/lib/python2.7/site-packages/tornado/tcpserver.py", line 162, in bind
    backlog=backlog)
  File "/home/amgaera/default/local/lib/python2.7/site-packages/tornado/netutil.py", line 90, in bind_sockets
    sock.bind(sockaddr)
  File "/usr/lib/python2.7/socket.py", line 224, in meth
    return getattr(self._sock,name)(*args)
error: [Errno 98] Address already in use

Output of pip freeze for the virtualenv I use:

Genshi==0.7
Jinja2==2.7.1
MarkupSafe==0.18
PyHamcrest==1.7.1
PyYAML==3.10
Pygments==1.6
Sphinx==1.1.3
argparse==1.2.1
asyncmongo==1.2.2
distribute==0.7.3
docutils==0.11
logutils==0.3.3
mimeparse==0.1.3
mock==1.0.1
nose==1.3.0
nose-testconfig==0.9
phpserialize==1.3
pika==0.9.13
psycopg2==2.5.1
pyaml==13.07.1
pycassa==1.9.1
pycurl==7.19.0
pyes==0.20.1
pymongo==2.6.2
python-dateutil==2.1
python-memcached==1.53
requests==1.2.3
rmock==0.3.2
six==1.3.0
sockjs-tornado==1.0.0
thrift==0.9.1
tornado==3.1.1
urllib3==1.6
voluptuous==0.4
wsgiref==0.1.2
tikan commented 11 years ago

Confirmed, a few tests are not stable enough. I'll look at it.