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

Doug Hellmann doug.hellmann at dreamhost.com
Mon Aug 6 19:13:53 UTC 2012


On Mon, Aug 6, 2012 at 1:21 PM, John Tran <njhtran at gmail.com> wrote:

> 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'
>

Are you running the tests against a real MongoDB instance or with the MiM
(Mongo in Memory) implementation from Ming?

Which version of PyMongo do you have and how was it installed?

Doug
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20120806/c6b88ed3/attachment.html>


More information about the OpenStack-dev mailing list