Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ERROR: tearDownClass (zaza.openstack.charm_tests.manila_ganesha.tests.ManilaGaneshaTests) #771

Open
freyes opened this issue May 24, 2022 · 0 comments · May be fixed by #772
Open

ERROR: tearDownClass (zaza.openstack.charm_tests.manila_ganesha.tests.ManilaGaneshaTests) #771

freyes opened this issue May 24, 2022 · 0 comments · May be fixed by #772
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@freyes
Copy link
Member

freyes commented May 24, 2022

the function network_name_from_instance() doesn't consider the case where an instance has no networks configured (no ports attached), in that scenario the iterator will raise StopIteration

ci run failure: https://review.opendev.org/c/openstack/charm-manila/+/841964

2022-05-23 13:59:56 [INFO] ## Running Test zaza.openstack.charm_tests.manila_ganesha.tests.ManilaGaneshaTests ##
2022-05-23 14:00:08 [INFO] looking at application: {'name': 'keystone', 'type': {'pkg': 'keystone', 'origin_setting': 'openstack-origin'}}
2022-05-23 14:00:12 [INFO] Using keystone API V3 (or later) for overcloud auth
scp: /usr/local/share/ca-certificates/keystone_juju_ca_cert.crt: No such file or directory
2022-05-23 14:00:17 [INFO] looking at application: {'name': 'keystone', 'type': {'pkg': 'keystone', 'origin_setting': 'openstack-origin'}}
2022-05-23 14:00:20 [INFO] test_manila_share (zaza.openstack.charm_tests.manila_ganesha.tests.ManilaGaneshaTests)
2022-05-23 14:00:20 [INFO] Test that a Manila share can be accessed on two instances.
2022-05-23 14:00:20 [INFO]  ... 
2022-05-23 14:00:32 [INFO] looking at application: {'name': 'keystone', 'type': {'pkg': 'keystone', 'origin_setting': 'openstack-origin'}}
2022-05-23 14:00:36 [INFO] Using keystone API V3 (or later) for overcloud auth
scp: /usr/local/share/ca-certificates/keystone_juju_ca_cert.crt: No such file or directory
2022-05-23 14:00:40 [INFO] looking at application: {'name': 'keystone', 'type': {'pkg': 'keystone', 'origin_setting': 'openstack-origin'}}
2022-05-23 14:00:45 [INFO] Launching instance zaza-manilatests-ins-1
2022-05-23 14:00:48 [INFO] Checking instance is active
2022-05-23 14:00:48 [INFO] resource: resource 6eddc5fd-e58e-4fae-a7f2-0ad38e588945 in BUILD state, waiting for ACTIVE
2022-05-23 14:00:49 [INFO] resource: resource 6eddc5fd-e58e-4fae-a7f2-0ad38e588945 in BUILD state, waiting for ACTIVE
2022-05-23 14:00:52 [INFO] resource: resource 6eddc5fd-e58e-4fae-a7f2-0ad38e588945 in BUILD state, waiting for ACTIVE
2022-05-23 14:00:56 [INFO] resource: resource 6eddc5fd-e58e-4fae-a7f2-0ad38e588945 in BUILD state, waiting for ACTIVE
2022-05-23 14:01:04 [INFO] resource: resource 6eddc5fd-e58e-4fae-a7f2-0ad38e588945 in BUILD state, waiting for ACTIVE
2022-05-23 14:01:21 [INFO] resource: resource 6eddc5fd-e58e-4fae-a7f2-0ad38e588945 in BUILD state, waiting for ACTIVE
2022-05-23 14:01:53 [INFO] resource: resource 6eddc5fd-e58e-4fae-a7f2-0ad38e588945 in BUILD state, waiting for ACTIVE
2022-05-23 14:02:57 [INFO] resource: resource 6eddc5fd-e58e-4fae-a7f2-0ad38e588945 in BUILD state, waiting for ACTIVE
2022-05-23 14:04:58 [INFO] resource: resource 6eddc5fd-e58e-4fae-a7f2-0ad38e588945 in BUILD state, waiting for ACTIVE
2022-05-23 14:06:59 [INFO] resource: resource 6eddc5fd-e58e-4fae-a7f2-0ad38e588945 in BUILD state, waiting for ACTIVE
2022-05-23 14:09:00 [INFO] resource: resource 6eddc5fd-e58e-4fae-a7f2-0ad38e588945 in BUILD state, waiting for ACTIVE
2022-05-23 14:11:00 [INFO] resource: resource 6eddc5fd-e58e-4fae-a7f2-0ad38e588945 in BUILD state, waiting for ACTIVE
2022-05-23 14:13:01 [INFO] resource: resource 6eddc5fd-e58e-4fae-a7f2-0ad38e588945 in BUILD state, waiting for ACTIVE
2022-05-23 14:15:02 [INFO] resource: resource 6eddc5fd-e58e-4fae-a7f2-0ad38e588945 in BUILD state, waiting for ACTIVE
2022-05-23 14:17:02 [INFO] resource: resource 6eddc5fd-e58e-4fae-a7f2-0ad38e588945 in BUILD state, waiting for ACTIVE
2022-05-23 14:19:04 [INFO] resource: resource 6eddc5fd-e58e-4fae-a7f2-0ad38e588945 in BUILD state, waiting for ACTIVE
2022-05-23 14:19:07 [INFO] Removing already existing instance (6eddc5fd-e58e-4fae-a7f2-0ad38e588945) with requested name (zaza-manilatests-ins-1)
2022-05-23 14:21:16 [INFO] Removing already existing instance (6eddc5fd-e58e-4fae-a7f2-0ad38e588945) with requested name (zaza-manilatests-ins-1)
2022-05-23 14:23:23 [INFO] ERROR
2022-05-23 14:23:23 [INFO] Cleaning up test Nova servers
2022-05-23 14:23:24 [INFO] ERROR
2022-05-23 14:23:24 [INFO] ======================================================================
2022-05-23 14:23:24 [INFO] ERROR: test_manila_share (zaza.openstack.charm_tests.manila_ganesha.tests.ManilaGaneshaTests)
2022-05-23 14:23:24 [INFO] Test that a Manila share can be accessed on two instances.
2022-05-23 14:23:24 [INFO] ----------------------------------------------------------------------
2022-05-23 14:23:24 [INFO] Traceback (most recent call last):
2022-05-23 14:23:24 [INFO]   File "/home/ubuntu/src/review.opendev.org/openstack/charm-manila/src/.tox/func-target/lib/python3.8/site-packages/zaza/openstack/charm_tests/test_utils.py", line 672, in launch_guest
2022-05-23 14:23:24 [INFO]     openstack_utils.delete_resource(
2022-05-23 14:23:24 [INFO]   File "/home/ubuntu/src/review.opendev.org/openstack/charm-manila/src/.tox/func-target/lib/python3.8/site-packages/zaza/openstack/utilities/openstack.py", line 2418, in delete_resource
2022-05-23 14:23:24 [INFO]     resource_removed(resource, resource_id, msg)
2022-05-23 14:23:24 [INFO]   File "/home/ubuntu/src/review.opendev.org/openstack/charm-manila/src/.tox/func-target/lib/python3.8/site-packages/zaza/openstack/utilities/openstack.py", line 2395, in resource_removed
2022-05-23 14:23:24 [INFO]     retryer(
2022-05-23 14:23:24 [INFO]   File "/home/ubuntu/src/review.opendev.org/openstack/charm-manila/src/.tox/func-target/lib/python3.8/site-packages/tenacity/__init__.py", line 404, in __call__
2022-05-23 14:23:24 [INFO]     do = self.iter(retry_state=retry_state)
2022-05-23 14:23:24 [INFO]   File "/home/ubuntu/src/review.opendev.org/openstack/charm-manila/src/.tox/func-target/lib/python3.8/site-packages/tenacity/__init__.py", line 360, in iter
2022-05-23 14:23:24 [INFO]     raise retry_exc.reraise()
2022-05-23 14:23:24 [INFO]   File "/home/ubuntu/src/review.opendev.org/openstack/charm-manila/src/.tox/func-target/lib/python3.8/site-packages/tenacity/__init__.py", line 193, in reraise
2022-05-23 14:23:24 [INFO]     raise self.last_attempt.result()
2022-05-23 14:23:24 [INFO]   File "/usr/lib/python3.8/concurrent/futures/_base.py", line 437, in result
2022-05-23 14:23:24 [INFO]     return self.__get_result()
2022-05-23 14:23:24 [INFO]   File "/usr/lib/python3.8/concurrent/futures/_base.py", line 389, in __get_result
2022-05-23 14:23:24 [INFO]     raise self._exception
2022-05-23 14:23:24 [INFO]   File "/home/ubuntu/src/review.opendev.org/openstack/charm-manila/src/.tox/func-target/lib/python3.8/site-packages/tenacity/__init__.py", line 407, in __call__
2022-05-23 14:23:24 [INFO]     result = fn(*args, **kwargs)
2022-05-23 14:23:24 [INFO]   File "/home/ubuntu/src/review.opendev.org/openstack/charm-manila/src/.tox/func-target/lib/python3.8/site-packages/zaza/openstack/utilities/openstack.py", line 2362, in _resource_removed
2022-05-23 14:23:24 [INFO]     assert len(matching) == 0
2022-05-23 14:23:24 [INFO] AssertionError
2022-05-23 14:23:24 [INFO] The above exception was the direct cause of the following exception:
2022-05-23 14:23:24 [INFO] Traceback (most recent call last):
2022-05-23 14:23:24 [INFO]   File "/home/ubuntu/src/review.opendev.org/openstack/charm-manila/src/.tox/func-target/lib/python3.8/site-packages/zaza/openstack/charm_tests/manila/tests.py", line 329, in test_manila_share
2022-05-23 14:23:24 [INFO]     instance_1 = self.launch_guest(
2022-05-23 14:23:24 [INFO]   File "/home/ubuntu/src/review.opendev.org/openstack/charm-manila/src/.tox/func-target/lib/python3.8/site-packages/zaza/openstack/charm_tests/test_utils.py", line 660, in launch_guest
2022-05-23 14:23:24 [INFO]     for attempt in tenacity.Retrying(
2022-05-23 14:23:24 [INFO]   File "/home/ubuntu/src/review.opendev.org/openstack/charm-manila/src/.tox/func-target/lib/python3.8/site-packages/tenacity/__init__.py", line 382, in __iter__
2022-05-23 14:23:24 [INFO]     do = self.iter(retry_state=retry_state)
2022-05-23 14:23:24 [INFO]   File "/home/ubuntu/src/review.opendev.org/openstack/charm-manila/src/.tox/func-target/lib/python3.8/site-packages/tenacity/__init__.py", line 361, in iter
2022-05-23 14:23:24 [INFO]     raise retry_exc from fut.exception()
2022-05-23 14:23:24 [INFO] tenacity.RetryError: RetryError[<Future at 0x7f2c9f7204f0 state=finished raised AssertionError>]
2022-05-23 14:23:24 [INFO] ======================================================================
2022-05-23 14:23:24 [INFO] ERROR: tearDownClass (zaza.openstack.charm_tests.manila_ganesha.tests.ManilaGaneshaTests)
2022-05-23 14:23:24 [INFO] ----------------------------------------------------------------------
2022-05-23 14:23:24 [INFO] Traceback (most recent call last):
2022-05-23 14:23:24 [INFO]   File "/home/ubuntu/src/review.opendev.org/openstack/charm-manila/src/.tox/func-target/lib/python3.8/site-packages/zaza/openstack/charm_tests/manila/tests.py", line 142, in tearDownClass
2022-05-23 14:23:24 [INFO]     fips_reservations += neutron_tests.floating_ips_from_instance(vm)
2022-05-23 14:23:24 [INFO]   File "/home/ubuntu/src/review.opendev.org/openstack/charm-manila/src/.tox/func-target/lib/python3.8/site-packages/zaza/openstack/charm_tests/neutron/tests.py", line 1028, in floating_ips_from_instance
2022-05-23 14:23:24 [INFO]     return ips_from_instance(instance, 'floating')
2022-05-23 14:23:24 [INFO]   File "/home/ubuntu/src/review.opendev.org/openstack/charm-manila/src/.tox/func-target/lib/python3.8/site-packages/zaza/openstack/charm_tests/neutron/tests.py", line 1073, in ips_from_instance
2022-05-23 14:23:24 [INFO]     network_name_from_instance(instance)]
2022-05-23 14:23:24 [INFO]   File "/home/ubuntu/src/review.opendev.org/openstack/charm-manila/src/.tox/func-target/lib/python3.8/site-packages/zaza/openstack/charm_tests/neutron/tests.py", line 1052, in network_name_from_instance
2022-05-23 14:23:24 [INFO]     return next(iter(instance.addresses))
2022-05-23 14:23:24 [INFO] StopIteration
2022-05-23 14:23:24 [INFO] ----------------------------------------------------------------------
2022-05-23 14:23:24 [INFO] Ran 1 test in 1407.570s
freyes added a commit to freyes/zaza-openstack-tests that referenced this issue May 24, 2022
This change covers the case where an instance has no ports (addresses)
attached making the function network_name_from_instance() raise a
StopIteration since the "addresses" dict is empty.

Traceback (most recent call last):
  File "[...]/zaza/openstack/charm_tests/manila/tests.py", line 142, in tearDownClass
    fips_reservations += neutron_tests.floating_ips_from_instance(vm)
  File "[...[/zaza/openstack/charm_tests/neutron/tests.py", line 1028, in floating_ips_from_instance
    return ips_from_instance(instance, 'floating')
  File "[...]/zaza/openstack/charm_tests/neutron/tests.py", line 1073, in ips_from_instance
    network_name_from_instance(instance)]
  File "[...]/zaza/openstack/charm_tests/neutron/tests.py", line 1052, in network_name_from_instance
    return next(iter(instance.addresses))
StopIteration

Fixes openstack-charmers#771
@freyes freyes linked a pull request May 24, 2022 that will close this issue
freyes added a commit to freyes/zaza-openstack-tests that referenced this issue May 24, 2022
This change covers the case where an instance has no ports (addresses)
attached making the function network_name_from_instance() raise a
StopIteration since the "addresses" dict is empty.

Traceback (most recent call last):
  File "[...]/zaza/openstack/charm_tests/manila/tests.py", line 142, in tearDownClass
    fips_reservations += neutron_tests.floating_ips_from_instance(vm)
  File "[...[/zaza/openstack/charm_tests/neutron/tests.py", line 1028, in floating_ips_from_instance
    return ips_from_instance(instance, 'floating')
  File "[...]/zaza/openstack/charm_tests/neutron/tests.py", line 1073, in ips_from_instance
    network_name_from_instance(instance)]
  File "[...]/zaza/openstack/charm_tests/neutron/tests.py", line 1052, in network_name_from_instance
    return next(iter(instance.addresses))
StopIteration

Fixes openstack-charmers#771
@ajkavanagh ajkavanagh added bug Something isn't working good first issue Good for newcomers labels May 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants