The test_plugin_role_conflict_with_plugin_and_core fails periodically in Nailgun

Bug #1520626 reported by Ilya Kharin
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fuel for OpenStack
Fix Committed
Medium
Ilya Kharin

Bug Description

This test fails periodically with error:

    ___ TestClusterObjectGetRoles.test_plugin_role_conflict_with_plugin_and_core ___
    [gw3] linux2 -- Python 2.7.6 /home/jenkins/workspace/gate-fuel-web-py27/nailgun/.tox/py27/bin/python2.7
    self = <nailgun.test.unit.test_objects.TestClusterObjectGetRoles testMethod=test_plugin_role_conflict_with_plugin_and_core>

        def test_plugin_role_conflict_with_plugin_and_core(self):
            self.create_plugin({
                'role_x': {
                    'name': 'Role X', 'description': 'Role X is ...', },
            })
            plugin_in_conflict = self.create_plugin({
                'role_x': {
                    'name': 'Role Y', 'description': 'Role Y is ...', },
                'role_a': {
                    'name': 'Role A', 'description': 'Role A is ...', },
            })

            message_pattern = (
                '^Plugin \(ID={0}\) is unable to register the following node '
                'roles: (.*)'
                .format(plugin_in_conflict.id))

            with self.assertRaisesRegexp(
                    errors.AlreadyExists, message_pattern) as cm:
                objects.Cluster.get_roles(self.cluster)

            # 0 - the whole message, 1 - is first match of (.*) pattern
            roles = re.match(message_pattern, str(cm.exception)).group(1)
            roles = [role.lstrip().rstrip() for role in roles.split(',')]

    > self.assertItemsEqual(roles, ['role_x', 'role_a'])
    E AssertionError: Element counts were not equal:
    E First has 0, Second has 1: 'role_x'

    nailgun/test/unit/test_objects.py:1408: AssertionError

It seems that the objects.ClusterPlugins.set_attributes method does not synchronize objects in the session but this test rely on it.

Ilya Kharin (akscram)
description: updated
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to fuel-web (master)

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

Changed in fuel:
assignee: nobody → Ilya Kharin (akscram)
status: New → In Progress
Dmitry Klenov (dklenov)
tags: added: area-python
Changed in fuel:
milestone: none → 8.0
importance: Undecided → Medium
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to fuel-web (master)

Reviewed: https://review.openstack.org/250898
Committed: https://git.openstack.org/cgit/openstack/fuel-web/commit/?id=1f30baada9f5c9fbc9ece1bd6d9955dba0ce980a
Submitter: Jenkins
Branch: master

commit 1f30baada9f5c9fbc9ece1bd6d9955dba0ce980a
Author: Ilya Kharin <email address hidden>
Date: Fri Nov 27 19:40:34 2015 +0300

    Refresh plugin objects when its attrs are updated

    Change-Id: Ib3f20fc6acec81bcaf0b5c486f1904bf1d90d36c
    Closes-Bug: #1520626

Changed in fuel:
status: In Progress → Fix Released
Changed in fuel:
status: Fix Released → Fix Committed
tags: added: dev-to-verify
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.