okfn/webstore-client — Issue #3: Tests fail with socket connection error
Author: rgrp
Created: 2011-10-14 13:05:46+00:00
State: open

Tests fail with errors like:

test_database_contains (test_client.WebstoreClientTestCase) ... Exception in thread server:
Traceback (most recent call last):
File "/usr/lib/python2.6/threading.py", line 532, in __bootstrap_inner
self.run()
File "/usr/lib/python2.6/threading.py", line 484, in run
self.__target(*self.__args, **self.__kwargs)
File "/home/rgrp/src/webstore-client/test/test_client.py", line 19, in run_webstore
app.run(port=6675)
File "/home/rgrp/venv/webstore/lib/python2.6/site-packages/flask/app.py", line 553, in run
return run_simple(host, port, self, **options)
File "/home/rgrp/venv/webstore/lib/python2.6/site-packages/werkzeug/serving.py", line 614, in run_simple
run_with_reloader(inner, extra_files, reloader_interval)
File "/home/rgrp/venv/webstore/lib/python2.6/site-packages/werkzeug/serving.py", line 529, in run_with_reloader
signal.signal(signal.SIGTERM, lambda *args: sys.exit(0))
ValueError: signal only works in main thread

ERROR
test_database_getitem (test_client.WebstoreClientTestCase) ... ERROR
test_database_table_listing (test_client.WebstoreClientTestCase) ... ERROR
test_table_add_row (test_client.WebstoreClientTestCase) ... ERROR
test_table_delete (test_client.WebstoreClientTestCase) ... ERROR
test_table_traverse_filter (test_client.WebstoreClientTestCase) ... ERROR
test_table_traverse_full (test_client.WebstoreClientTestCase) ... ERROR
test_table_traverse_limit (test_client.WebstoreClientTestCase) ... ERROR
test_table_update_row (test_client.WebstoreClientTestCase) ... ERROR

======================================================================
ERROR: test_database_contains (test_client.WebstoreClientTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/rgrp/src/webstore-client/test/test_client.py", line 38, in setUp
self.table.writerows(FIXTURES)
File "/home/rgrp/src/webstore-client/webstore/client/__init__.py", line 370, in writerows
return self._request("POST", query, rows)
File "/home/rgrp/src/webstore-client/webstore/client/__init__.py", line 164, in _request
response = self._raw_request(method, path, data, _headers)
File "/home/rgrp/src/webstore-client/webstore/client/__init__.py", line 150, in _raw_request
conn.request(method, path, data, _headers)
File "/usr/lib/python2.6/httplib.py", line 914, in request
self._send_request(method, url, body, headers)
File "/usr/lib/python2.6/httplib.py", line 951, in _send_request
self.endheaders()
File "/usr/lib/python2.6/httplib.py", line 908, in endheaders
self._send_output()
File "/usr/lib/python2.6/httplib.py", line 780, in _send_output
self.send(msg)
File "/usr/lib/python2.6/httplib.py", line 739, in send
self.connect()
File "/usr/lib/python2.6/httplib.py", line 720, in connect
self.timeout)
File "/usr/lib/python2.6/socket.py", line 547, in create_connection
for res in getaddrinfo(host, port, 0, SOCK_STREAM):
gaierror: [Errno -2] Name or service not known
-------------------- >> begin captured logging << --------------------
werkzeug: INFO: * Running on http://127.0.0.1:6675/