[openstack-dev] [metering] can't get tests to pass locally

John Tran njhtran at gmail.com
Mon Aug 6 17:21:13 UTC 2012


I'm having trouble getting all the tests to pass locally.  I'm using
the run_tests.sh as well as tox -epy27 the same results.  I attempted
to look into the console output for all 3 daemons to see why I'm
getting a 500 internal server error on the first few fails but didn't
see any output.  I can dig into it deeper but I'm hoping someone else
has run into this and know off the top of their head a quick fix.

======================================================================
ERROR: test_empty (tests.api.v1.test_list_users.TestListUsers)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/opt/stack/ceilometer/tests/api/v1/test_list_users.py", line
35, in test_empty
    data = self.get('/users')
  File "/opt/stack/ceilometer/ceilometer/tests/api.py", line 82, in get
    data = json.loads(rv.data)
  File "/usr/lib/python2.7/json/__init__.py", line 326, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python2.7/json/decoder.py", line 366, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python2.7/json/decoder.py", line 384, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
-------------------- >> begin captured stdout << ---------------------
RAW DATA: <Response 291 bytes [500 INTERNAL SERVER ERROR]>

--------------------- >> end captured stdout << ----------------------
-------------------- >> begin captured logging << --------------------
ceilometer.storage.impl_mongodb: INFO: connecting to MongoDB on localhost:27017
ceilometer.tests.api: DEBUG: Unable to connect to mongod, falling back to MIM
test: ERROR: Exception on /users [GET]
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line
1687, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line
1360, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line
1358, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line
1344, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/opt/stack/ceilometer/ceilometer/api/v1.py", line 49, in list_users
    users = flask.request.storage_conn.get_users(source=source)
  File "/opt/stack/ceilometer/ceilometer/storage/impl_mongodb.py",
line 261, in get_users
    return self.db.user.distinct('_id')
  File "/usr/lib/python2.7/dist-packages/pymongo/collection.py", line
1011, in distinct
    return self.find().distinct(key)
AttributeError: 'Cursor' object has no attribute 'distinct'
--------------------- >> end captured logging << ---------------------

======================================================================
ERROR: test_users (tests.api.v1.test_list_users.TestListUsers)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/opt/stack/ceilometer/tests/api/v1/test_list_users.py", line
73, in test_users
    data = self.get('/users')
  File "/opt/stack/ceilometer/ceilometer/tests/api.py", line 82, in get
    data = json.loads(rv.data)
  File "/usr/lib/python2.7/json/__init__.py", line 326, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python2.7/json/decoder.py", line 366, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python2.7/json/decoder.py", line 384, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
-------------------- >> begin captured stdout << ---------------------
RAW DATA: <Response 291 bytes [500 INTERNAL SERVER ERROR]>

--------------------- >> end captured stdout << ----------------------
-------------------- >> begin captured logging << --------------------
ceilometer.storage.impl_mongodb: INFO: connecting to MongoDB on localhost:27017
ceilometer.tests.api: DEBUG: Unable to connect to mongod, falling back to MIM
test: ERROR: Exception on /users [GET]
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line
1687, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line
1360, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line
1358, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line
1344, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/opt/stack/ceilometer/ceilometer/api/v1.py", line 49, in list_users
    users = flask.request.storage_conn.get_users(source=source)
  File "/opt/stack/ceilometer/ceilometer/storage/impl_mongodb.py",
line 261, in get_users
    return self.db.user.distinct('_id')
  File "/usr/lib/python2.7/dist-packages/pymongo/collection.py", line
1011, in distinct
    return self.find().distinct(key)
AttributeError: 'Cursor' object has no attribute 'distinct'
--------------------- >> end captured logging << ---------------------

======================================================================
ERROR: test_with_source (tests.api.v1.test_list_users.TestListUsers)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/opt/stack/ceilometer/tests/api/v1/test_list_users.py", line
111, in test_with_source
    data = self.get('/sources/test_list_users/users')
  File "/opt/stack/ceilometer/ceilometer/tests/api.py", line 82, in get
    data = json.loads(rv.data)
  File "/usr/lib/python2.7/json/__init__.py", line 326, in loads
    return _default_decoder.decode(s)
  File "/usr/lib/python2.7/json/decoder.py", line 366, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python2.7/json/decoder.py", line 384, in raw_decode
    raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
-------------------- >> begin captured stdout << ---------------------
RAW DATA: <Response 291 bytes [500 INTERNAL SERVER ERROR]>

--------------------- >> end captured stdout << ----------------------
-------------------- >> begin captured logging << --------------------
ceilometer.storage.impl_mongodb: INFO: connecting to MongoDB on localhost:27017
ceilometer.tests.api: DEBUG: Unable to connect to mongod, falling back to MIM
test: ERROR: Exception on /sources/test_list_users/users [GET]
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line
1687, in wsgi_app
    response = self.full_dispatch_request()
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line
1360, in full_dispatch_request
    rv = self.handle_user_exception(e)
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line
1358, in full_dispatch_request
    rv = self.dispatch_request()
  File "/usr/local/lib/python2.7/dist-packages/flask/app.py", line
1344, in dispatch_request
    return self.view_functions[rule.endpoint](**req.view_args)
  File "/opt/stack/ceilometer/ceilometer/api/v1.py", line 49, in list_users
    users = flask.request.storage_conn.get_users(source=source)
  File "/opt/stack/ceilometer/ceilometer/storage/impl_mongodb.py",
line 259, in get_users
    return self.db.user.find(q).distinct('_id')
AttributeError: 'Cursor' object has no attribute 'distinct'
--------------------- >> end captured logging << ---------------------

======================================================================
ERROR: test_get_projects (tests.storage.test_impl_mongodb.ProjectTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/opt/stack/ceilometer/tests/storage/test_impl_mongodb.py",
line 202, in test_get_projects
    projects = self.conn.get_projects()
  File "/opt/stack/ceilometer/ceilometer/storage/impl_mongodb.py",
line 273, in get_projects
    return self.db.project.distinct('_id')
  File "/usr/lib/python2.7/dist-packages/pymongo/collection.py", line
1011, in distinct
    return self.find().distinct(key)
AttributeError: 'Cursor' object has no attribute 'distinct'
-------------------- >> begin captured logging << --------------------
ceilometer.storage.impl_mongodb: INFO: connecting to MongoDB on localhost:27017
tests.storage.test_impl_mongodb: DEBUG: Unable to connect to mongod,
falling back to MIM
--------------------- >> end captured logging << ---------------------

======================================================================
ERROR: test_get_projects_by_source (tests.storage.test_impl_mongodb.ProjectTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/opt/stack/ceilometer/tests/storage/test_impl_mongodb.py",
line 207, in test_get_projects_by_source
    projects = self.conn.get_projects(source='test-1')
  File "/opt/stack/ceilometer/ceilometer/storage/impl_mongodb.py",
line 271, in get_projects
    return self.db.project.find(q).distinct('_id')
AttributeError: 'Cursor' object has no attribute 'distinct'
-------------------- >> begin captured logging << --------------------
ceilometer.storage.impl_mongodb: INFO: connecting to MongoDB on localhost:27017
tests.storage.test_impl_mongodb: DEBUG: Unable to connect to mongod,
falling back to MIM
--------------------- >> end captured logging << ---------------------

======================================================================
ERROR: test_get_users (tests.storage.test_impl_mongodb.UserTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/opt/stack/ceilometer/tests/storage/test_impl_mongodb.py",
line 181, in test_get_users
    users = self.conn.get_users()
  File "/opt/stack/ceilometer/ceilometer/storage/impl_mongodb.py",
line 261, in get_users
    return self.db.user.distinct('_id')
  File "/usr/lib/python2.7/dist-packages/pymongo/collection.py", line
1011, in distinct
    return self.find().distinct(key)
AttributeError: 'Cursor' object has no attribute 'distinct'
-------------------- >> begin captured logging << --------------------
ceilometer.storage.impl_mongodb: INFO: connecting to MongoDB on localhost:27017
tests.storage.test_impl_mongodb: DEBUG: Unable to connect to mongod,
falling back to MIM
--------------------- >> end captured logging << ---------------------

======================================================================
ERROR: test_get_users_by_source (tests.storage.test_impl_mongodb.UserTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/opt/stack/ceilometer/tests/storage/test_impl_mongodb.py",
line 185, in test_get_users_by_source
    users = list(self.conn.get_users(source='test-1'))
  File "/opt/stack/ceilometer/ceilometer/storage/impl_mongodb.py",
line 259, in get_users
    return self.db.user.find(q).distinct('_id')
AttributeError: 'Cursor' object has no attribute 'distinct'
-------------------- >> begin captured logging << --------------------
ceilometer.storage.impl_mongodb: INFO: connecting to MongoDB on localhost:27017
tests.storage.test_impl_mongodb: DEBUG: Unable to connect to mongod,
falling back to MIM
--------------------- >> end captured logging << ---------------------

----------------------------------------------------------------------
Ran 89 tests in 7.003s

FAILED (SKIP=3, errors=7)
Exception KeyError: KeyError(37850064,) in <module 'threading' from
'/usr/lib/python2.7/threading.pyc'> ignored
jtran at ubuntu-mbp:/opt/stack/ceilometer$



More information about the OpenStack-dev mailing list