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

John Tran njhtran at gmail.com
Wed Aug 15 23:00:22 UTC 2012


I've finally had a chance to look at this, in my case I've made some
progress by:

export CEILOMETER_TEST_LIVE=1

That took care of all the mongodb connection error messages.  However,
I'm getting a few other unrelated errors will

On Mon, Aug 6, 2012 at 2:11 PM, Doug Hellmann
<doug.hellmann at dreamhost.com> wrote:
>
>
> On Mon, Aug 6, 2012 at 3:26 PM, John Tran <njhtran at gmail.com> wrote:
>>
>> Doug,
>>
>> Thanks for helping me out.  I'm using a real MongoDB instance and the
>> python-pymongo dpkg installed is version 2.1-1
>
>
> It's possible that method was added in PyMongo 2.2. I have "pymongo==2.2.1"
> from pip.
>
> If updating fixes your tests we should peg the version in our requirements
> file.
>
> Doug
>
>>
>>
>> On Mon, Aug 6, 2012 at 12:13 PM, Doug Hellmann
>> <doug.hellmann at dreamhost.com> wrote:
>> > 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
>> >
>> >
>> > _______________________________________________
>> > OpenStack-dev mailing list
>> > OpenStack-dev at lists.openstack.org
>> > http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>> >
>>
>> _______________________________________________
>> OpenStack-dev mailing list
>> OpenStack-dev at lists.openstack.org
>> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>
>
>
> _______________________________________________
> OpenStack-dev mailing list
> OpenStack-dev at lists.openstack.org
> http://lists.openstack.org/cgi-bin/mailman/listinfo/openstack-dev
>



More information about the OpenStack-dev mailing list