test_claim_lifecycle is racy

Bug #1477564 reported by Thomas Herve
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
zaqar
Fix Released
Medium
Thomas Herve

Bug Description

I got this intermittent error:

-07-23 09:26:13.060 | pythonlogging:'zaqar': {{{Stage <zaqar.storage.mongodb.messages.MessageQueueHandler object at 0x7f6cc41ff9d0> does not implement create}}}
2015-07-23 09:26:13.060 |
2015-07-23 09:26:13.060 | Traceback (most recent call last):
2015-07-23 09:26:13.060 | File "zaqar/tests/unit/storage/base.py", line 793, in test_claim_lifecycle
2015-07-23 09:26:13.060 | self.assertEqual(messages, messages2)
2015-07-23 09:26:13.060 | File "/home/jenkins/workspace/gate-zaqar-python27/.tox/py27/local/lib/python2.7/site-packages/testtools/testcase.py", line 350, in assertEqual
2015-07-23 09:26:13.061 | self.assertThat(observed, matcher, message)
2015-07-23 09:26:13.061 | File "/home/jenkins/workspace/gate-zaqar-python27/.tox/py27/local/lib/python2.7/site-packages/testtools/testcase.py", line 435, in assertThat
2015-07-23 09:26:13.061 | raise mismatch_error
2015-07-23 09:26:13.061 | testtools.matchers._impl.MismatchError: !=:
5-07-23 09:26:13.061 | reference = [{'age': 0,
2015-07-23 09:26:13.061 | 'body': {u'event': u'Event number 0'},
2015-07-23 09:26:13.061 | 'claim_id': '55b0b3345c18f80f974fc694',
2015-07-23 09:26:13.061 | 'id': '55b0b3345c18f80f974fc680',
2015-07-23 09:26:13.061 | 'ttl': 120},
...
5-07-23 09:26:13.067 | actual = [{'age': 1,
2015-07-23 09:26:13.067 | 'body': {u'event': u'Event number 0'},
2015-07-23 09:26:13.067 | 'claim_id': '55b0b3345c18f80f974fc694',
2015-07-23 09:26:13.068 | 'id': '55b0b3345c18f80f974fc680',
2015-07-23 09:26:13.068 | 'ttl': 120}

Age was bumped from 0 to 1 between to the 2 asserts, so probably an extra slow slave? It's worth removing it I think.

Thomas Herve (therve)
Changed in zaqar:
assignee: nobody → Thomas Herve (therve)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to zaqar (master)

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

Changed in zaqar:
status: New → In Progress
Changed in zaqar:
milestone: none → liberty-rc1
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to zaqar (master)

Reviewed: https://review.openstack.org/220521
Committed: https://git.openstack.org/cgit/openstack/zaqar/commit/?id=8e8adb16c4be30e635f3984e176e6b4517113a7b
Submitter: Jenkins
Branch: master

commit 8e8adb16c4be30e635f3984e176e6b4517113a7b
Author: Thomas Herve <email address hidden>
Date: Fri Sep 4 16:07:31 2015 +0200

    Remove race condition in test_claim_lifecycle

    THe age returned by claims can differ between 2 asserts, so let's make
    sure we don't uselessly check it.

    Change-Id: Ide47526290bce36d939bd8a26e3bc320dc32c9fa
    Closes-Bug: #1477564

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

Other bug subscribers

Remote bug watches

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