[openstack-dev] [metering] mongo tests fail when using ming

John Tran njhtran at gmail.com
Mon Sep 17 22:39:33 UTC 2012


When I use CEILOMETER_LIVE_TEST=1, all tests pass just fine but just
so darn slow in comparison to the MIM tests.  Therefore, I'm trying to
figure out what my problem is, maybe someone knows the answer.   Here
is one of the tests traceback but I've added some custom print stubs
to help troubleshoot.

I've stubbed 'QUERY' to see what the filter is.   It's showing a
filter expression to get any raw events $gte (2012, 7, 2, 10, 42) &&
$lt (2012, 7, 2, 10, 43).

The results (stubbed 'EVENTS') are coming back empty, although the
expected result should have 1 meter object.

The stubbed 'ALL' is a list of timestamps for ALL meter objects and
clearly I see one that has a timestamp of 2012-07-02 10:42:00, which
should be EQUAL to the $gte argument.

$ ./run_tests.sh
storage.test_impl_mongodb:MeterTest.test_get_raw_events_by_both_times
+ rm -rf cover
+ [ ! -z  ]
+ nosetests storage.test_impl_mongodb:MeterTest.test_get_raw_events_by_both_times
test_get_raw_events_by_both_times (storage.test_impl_mongodb.MeterTest) ... FAIL

======================================================================
FAIL: test_get_raw_events_by_both_times (storage.test_impl_mongodb.MeterTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/opt/stack/ceilometer/tests/storage/test_impl_mongodb.py",
line 364, in test_get_raw_events_by_both_times
    assert length == 1
AssertionError:
    [] = list(self.conn.get_raw_events(<ceilometer.storage.EventFilter
object at 0x2ca7f50>))
    0 = len([])
>>  assert 0 == 1
    assert [][0]['timestamp'] == <module 'datetime' from
'/usr/lib/python2.7/lib-dynload/datetime.so'>.<module 'datetime' from
'/usr/lib/python2.7/lib-dynload/datetime.so'>(2012, 7, 2, 10, 42)

-------------------- >> begin captured stdout << ---------------------


QUERY:
{'timestamp': {'$gte': datetime.datetime(2012, 7, 2, 10, 42), '$lt':
datetime.datetime(2012, 7, 2, 10, 43)}}


EVENTS:
[]


ALL:
2012-07-02 10:43:00
2012-07-02 10:41:00
2012-07-02 10:40:00
2012-07-02 10:42:00
2012-07-02 10:41:00

--------------------- >> end captured stdout << ----------------------
-------------------- >> begin captured logging << --------------------
ceilometer.storage.impl_mongodb: INFO: connecting to MongoDB on localhost:27017
storage.test_impl_mongodb: DEBUG: Unable to connect to mongod, falling
back to MIM
--------------------- >> end captured logging << ---------------------

----------------------------------------------------------------------
Ran 1 test in 0.073s

FAILED (failures=1)



More information about the OpenStack-dev mailing list