tests.api.v2.test_query.TestQuery.test_query_to_kwargs_timestamp_mapping fails sometimes

Bug #1223346 reported by Julien Danjou
26
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Ceilometer
Fix Released
High
Julien Danjou

Bug Description

2013-09-10 11:02:04.921 | ======================================================================
2013-09-10 11:02:04.921 | FAIL: tests.api.v2.test_query.TestQuery.test_query_to_kwargs_timestamp_mapping
2013-09-10 11:02:04.921 | tags: worker-2
2013-09-10 11:02:04.922 | ----------------------------------------------------------------------
2013-09-10 11:02:04.922 | Empty attachments:
2013-09-10 11:02:04.922 | pythonlogging:''
2013-09-10 11:02:04.923 |
2013-09-10 11:02:04.923 | Traceback (most recent call last):
2013-09-10 11:02:04.923 | File "tests/api/v2/test_query.py", line 148, in test_query_to_kwargs_timestamp_mapping
2013-09-10 11:02:04.923 | self.assertEqual(kwargs.get('end_timestamp'), end)
2013-09-10 11:02:04.924 | File "/home/jenkins/workspace/gate-ceilometer-python26/.tox/py26/lib/python2.6/site-packages/testtools/testcase.py", line 322, in assertEqual
2013-09-10 11:02:04.924 | self.assertThat(observed, matcher, message)
2013-09-10 11:02:04.924 | File "/home/jenkins/workspace/gate-ceilometer-python26/.tox/py26/lib/python2.6/site-packages/testtools/testcase.py", line 417, in assertThat
2013-09-10 11:02:04.925 | raise MismatchError(matchee, matcher, mismatch, verbose)
2013-09-10 11:02:04.925 | MismatchError: !=:
2013-09-10 11:02:04.925 | reference = datetime.datetime(2013, 9, 10, 10, 59, 57, 520680)
2013-09-10 11:02:04.926 | actual = datetime.datetime(2013, 9, 10, 10, 59, 57, 520681)
2013-09-10 11:02:04.926 | ======================================================================
http://logs.openstack.org/62/45062/1/gate/gate-ceilometer-python26/33a53a7/console.html

Julien Danjou (jdanjou)
Changed in ceilometer:
status: New → Confirmed
importance: Undecided → High
Revision history for this message
gordon chung (chungg) wrote :

i've edited that test in my patch to add tests to _query_to_kwargs. it reworks the test to use timedelta -- it may resolve it?

https://review.openstack.org/#/c/43796/

Julien Danjou (jdanjou)
Changed in ceilometer:
assignee: nobody → Julien Danjou (jdanjou)
Revision history for this message
gordon chung (chungg) wrote :

for reference, another case where it fails similarly.

======================================================================
2013-09-20 16:24:54.750 | FAIL: tests.collector.test_service.TestCollectorService.test_extract_when
2013-09-20 16:24:54.750 | tags: worker-0
2013-09-20 16:24:54.751 | ----------------------------------------------------------------------
2013-09-20 16:24:54.751 | Empty attachments:
2013-09-20 16:24:54.751 | pythonlogging:''
2013-09-20 16:24:54.751 |
2013-09-20 16:24:54.751 | Traceback (most recent call last):
2013-09-20 16:24:54.751 | File "tests/collector/test_service.py", line 289, in test_extract_when
2013-09-20 16:24:54.751 | modified)
2013-09-20 16:24:54.752 | File "/home/jenkins/workspace/gate-ceilometer-python27/.tox/py27/local/lib/python2.7/site-packages/testtools/testcase.py", line 322, in assertEqual
2013-09-20 16:24:54.752 | self.assertThat(observed, matcher, message)
2013-09-20 16:24:54.752 | File "/home/jenkins/workspace/gate-ceilometer-python27/.tox/py27/local/lib/python2.7/site-packages/testtools/testcase.py", line 417, in assertThat
2013-09-20 16:24:54.752 | raise MismatchError(matchee, matcher, mismatch, verbose)
2013-09-20 16:24:54.752 | MismatchError: !=:
2013-09-20 16:24:54.752 | reference = datetime.datetime(2013, 9, 20, 16, 25, 44, 261046)
2013-09-20 16:24:54.752 | actual = datetime.datetime(2013, 9, 20, 16, 25, 44, 261047)

Revision history for this message
Terri Yu (terriyu) wrote :

@gordon The bug I reported earlier, marked as a duplicate of this one, has a similar failure in the same test:

https://bugs.launchpad.net/ceilometer/+bug/1224341

Changed in ceilometer:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ceilometer (master)

Reviewed: https://review.openstack.org/47857
Committed: http://github.com/openstack/ceilometer/commit/e9ab825be8858c32bab272b087af1a324cde1026
Submitter: Jenkins
Branch: master

commit e9ab825be8858c32bab272b087af1a324cde1026
Author: Julien Danjou <email address hidden>
Date: Mon Sep 23 17:29:44 2013 +0200

    service: check that timestamps are almost equals

    Sometimes timestamp get rounded during conversions and fails. Let's use
    assertAlmostEqual to be safe.

    Change-Id: I79e935d4b54013a18d2e07e71411f2ead94d977f
    Fixes-Bug: #1223346

Changed in ceilometer:
status: In Progress → Fix Committed
Revision history for this message
Terri Yu (terriyu) wrote :

The bug appeared again:

2013-09-27 01:41:29.115 | ======================================================================
2013-09-27 01:41:29.116 | FAIL: tests.api.v2.test_query.TestQueryToKwArgs.test_sample_filter_timestamp
2013-09-27 01:41:29.116 | tags: worker-3
2013-09-27 01:41:29.116 | ----------------------------------------------------------------------
2013-09-27 01:41:29.116 | Empty attachments:
2013-09-27 01:41:29.117 | pythonlogging:''
2013-09-27 01:41:29.117 |
2013-09-27 01:41:29.117 | Traceback (most recent call last):
2013-09-27 01:41:29.118 | File "tests/api/v2/test_query.py", line 217, in test_sample_filter_timestamp
2013-09-27 01:41:29.118 | self.assertEqual(kwargs['start'], ts_start)
2013-09-27 01:41:29.118 | File "/home/jenkins/workspace/gate-ceilometer-python26/.tox/py26/lib/python2.6/site-packages/testtools/testcase.py", line 322, in assertEqual
2013-09-27 01:41:29.119 | self.assertThat(observed, matcher, message)
2013-09-27 01:41:29.119 | File "/home/jenkins/workspace/gate-ceilometer-python26/.tox/py26/lib/python2.6/site-packages/testtools/testcase.py", line 417, in assertThat
2013-09-27 01:41:29.119 | raise MismatchError(matchee, matcher, mismatch, verbose)
2013-09-27 01:41:29.119 | MismatchError: !=:
2013-09-27 01:41:29.120 | reference = datetime.datetime(2013, 9, 27, 1, 38, 40, 255189)
2013-09-27 01:41:29.120 | actual = datetime.datetime(2013, 9, 27, 1, 38, 40, 255190)

http://logs.openstack.org/94/47894/3/check/gate-ceilometer-python26/82d580a/console.html

Revision history for this message
Julien Danjou (jdanjou) wrote :

Good catch Terri, not all the places have been fixed indeed, so it might appears once in a while. I'm reopening this bug and will fix that on Monday.

Changed in ceilometer:
status: Fix Committed → Confirmed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to ceilometer (master)

Fix proposed to branch: master
Review: https://review.openstack.org/48911

Changed in ceilometer:
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ceilometer (master)

Reviewed: https://review.openstack.org/48911
Committed: http://github.com/openstack/ceilometer/commit/5559c5962272e61aca9f4479ec6c194bf9c486a5
Submitter: Jenkins
Branch: master

commit 5559c5962272e61aca9f4479ec6c194bf9c486a5
Author: Julien Danjou <email address hidden>
Date: Mon Sep 30 11:23:49 2013 +0200

    tests: fix rounding issue in timestamp comparison

    Change-Id: I5fad200a97933180bb7ef2e9b6324d4fc7756fbf
    Fixes-Bug: #1223346

Changed in ceilometer:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in ceilometer:
milestone: none → havana-rc1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in ceilometer:
milestone: havana-rc1 → 2013.2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.