mistral.tests.unit.actions.openstack.test_generator.GeneratorTest.test_generator failed in stable/rocky

Bug #1837468 reported by Guang Yee
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mistral
New
Undecided
Unassigned

Bug Description

With the latest openstacksdk version 0.7.3, mistral.tests.unit.actions.openstack.test_generator.GeneratorTest.test_generator failed with the following error:

Traceback (most recent call last):
  File "mistral/actions/openstack/action_generator/base.py", line 143, in create_actions
    client_method = class_.get_fake_client_method()
  File "mistral/actions/openstack/base.py", line 75, in get_fake_client_method
    return cls._get_client_method(cls._get_fake_client())
  File "mistral/actions/openstack/actions.py", line 827, in _get_fake_client
    return cls._get_client_class()(authenticator=sess.auth)
  File "/home/gyee/projects/openstack/mistral/.tox/py27/local/lib/python2.7/site-packages/senlinclient/v1/client.py", line 28, in __init__
    self.service = self.conn.cluster
  File "/home/gyee/projects/openstack/mistral/.tox/py27/local/lib/python2.7/site-packages/openstack/service_description.py", line 95, in __get__
    allow_version_hack=True,
  File "/home/gyee/projects/openstack/mistral/.tox/py27/local/lib/python2.7/site-packages/openstack/config/cloud_region.py", line 470, in get_session_client
    info = client.get_endpoint_data()
  File "/home/gyee/projects/openstack/mistral/.tox/py27/local/lib/python2.7/site-packages/keystoneauth1/adapter.py", line 268, in get_endpoint_data
    return self.session.get_endpoint_data(auth or self.auth, **kwargs)
  File "/home/gyee/projects/openstack/mistral/.tox/py27/local/lib/python2.7/site-packages/keystoneauth1/session.py", line 1130, in get_endpoint_data
    return auth.get_endpoint_data(self, **kwargs)
  File "/home/gyee/projects/openstack/mistral/.tox/py27/local/lib/python2.7/site-packages/keystoneauth1/identity/base.py", line 271, in get_endpoint_data
    service_catalog = self.get_access(session).service_catalog
  File "/home/gyee/projects/openstack/mistral/.tox/py27/local/lib/python2.7/site-packages/keystoneauth1/identity/base.py", line 134, in get_access
    self.auth_ref = self.get_auth_ref(session)
  File "/home/gyee/projects/openstack/mistral/.tox/py27/local/lib/python2.7/site-packages/keystoneauth1/identity/generic/base.py", line 206, in get_auth_ref
    self._plugin = self._do_create_plugin(session)
  File "/home/gyee/projects/openstack/mistral/.tox/py27/local/lib/python2.7/site-packages/keystoneauth1/identity/generic/base.py", line 138, in _do_create_plugin
    authenticated=False)
  File "/home/gyee/projects/openstack/mistral/.tox/py27/local/lib/python2.7/site-packages/keystoneauth1/identity/base.py", line 601, in get_discovery
    authenticated=authenticated)
  File "/home/gyee/projects/openstack/mistral/.tox/py27/local/lib/python2.7/site-packages/keystoneauth1/discover.py", line 1399, in get_discovery
    disc = Discover(session, url, authenticated=authenticated)
  File "/home/gyee/projects/openstack/mistral/.tox/py27/local/lib/python2.7/site-packages/keystoneauth1/discover.py", line 498, in __init__
    authenticated=authenticated)
  File "/home/gyee/projects/openstack/mistral/.tox/py27/local/lib/python2.7/site-packages/keystoneauth1/discover.py", line 101, in get_version_data
    resp = session.get(url, headers=headers, authenticated=authenticated)
  File "/home/gyee/projects/openstack/mistral/.tox/py27/local/lib/python2.7/site-packages/keystoneauth1/session.py", line 1011, in get
    return self.request(url, 'GET', **kwargs)
  File "/home/gyee/projects/openstack/mistral/.tox/py27/local/lib/python2.7/site-packages/keystoneauth1/session.py", line 699, in request
    if not urllib.parse.urlparse(url).netloc:
  File "/usr/lib/python2.7/urlparse.py", line 143, in urlparse
    tuple = urlsplit(url, scheme, allow_fragments)
  File "/usr/lib/python2.7/urlparse.py", line 182, in urlsplit
    i = url.find(':')
AttributeError: 'NoneType' object has no attribute 'find'
{0} mistral.tests.unit.actions.openstack.test_generator.GeneratorTest.test_generator [0.638071s] ... FAILED

Captured traceback:
~~~~~~~~~~~~~~~~~~~
    Traceback (most recent call last):
      File "mistral/tests/unit/actions/openstack/test_generator.py", line 103, in test_generator
        name=action_name
      File "mistral/tests/unit/base.py", line 141, in _assert_single_item
        return self._assert_multiple_items(items, 1, **props)[0]
      File "mistral/tests/unit/base.py", line 164, in _assert_multiple_items
        "expected=%s, found=%s]" % (props, count, found))
      File "/home/gyee/projects/openstack/mistral/.tox/py27/local/lib/python2.7/site-packages/unittest2/case.py", line 690, in fail
        raise self.failureException(msg)
    AssertionError: Wrong number of items found [props={'name': 'senlin.get_profile'}, expected=1, found=0]

==============================
Failed 1 tests - output below:
==============================

mistral.tests.unit.actions.openstack.test_generator.GeneratorTest.test_generator
--------------------------------------------------------------------------------

Captured traceback:
~~~~~~~~~~~~~~~~~~~
    Traceback (most recent call last):
      File "mistral/tests/unit/actions/openstack/test_generator.py", line 103, in test_generator
        name=action_name
      File "mistral/tests/unit/base.py", line 141, in _assert_single_item
        return self._assert_multiple_items(items, 1, **props)[0]
      File "mistral/tests/unit/base.py", line 164, in _assert_multiple_items
        "expected=%s, found=%s]" % (props, count, found))
      File "/home/gyee/projects/openstack/mistral/.tox/py27/local/lib/python2.7/site-packages/unittest2/case.py", line 690, in fail
        raise self.failureException(msg)
    AssertionError: Wrong number of items found [props={'name': 'senlin.get_profile'}, expected=1, found=0]

The problem seem to have caused by this patch

https://review.opendev.org/#/c/587437/

When 'clustering_default_microversion' is set, it will trigger the Keystone version discovery logic. But in the Mistral unit tests, we are using a fake client so there's no need to exercise the actual HTTP requests.

We'll need to either disable version discovery or mock out the HTTP requests.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to mistral (stable/rocky)

Fix proposed to branch: stable/rocky
Review: https://review.opendev.org/672185

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to mistral (stable/rocky)

Reviewed: https://review.opendev.org/672185
Committed: https://git.openstack.org/cgit/openstack/mistral/commit/?id=f2a0b569f767e0f7cea844ed01accccf810ca618
Submitter: Zuul
Branch: stable/rocky

commit f2a0b569f767e0f7cea844ed01accccf810ca618
Author: Guang Yee <email address hidden>
Date: Mon Jul 22 15:15:00 2019 -0700

    disable triggering version discovery in test_generator unit tests

    Fixed unit.actions.openstack.test_generator.GeneratorTest.test_generator
    failure by avoid triggering version discovery as it needs to talk to
    Keystone server. Talking to a live Keystone server is not needed for
    this particular unit test.

    NOTE: this patch is only applicable to stable/rocky and with the latest
    openstacksdk 0.17.3 release.

    NOTE: this patch also includes change I9ab552dd4bf3826f358d73a4bddaf1885b1be130
    from https://review.opendev.org/#/c/672543/ as both are needed in order
    to pass Jenkins.

    Change-Id: Ib2c72e89612c9b2b4bccd37cb797804ea40e0b1f
    Closes-Bug: 1837468

tags: added: in-stable-rocky
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/mistral 7.1.0

This issue was fixed in the openstack/mistral 7.1.0 release.

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.