← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1866072] Re: TypeError: 'TestOpenStackClient' object is not subscriptable

 

Reviewed:  https://review.opendev.org/711211
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=cbffac7df1deb106876b4fba1d481ce70bda9302
Submitter: Zuul
Branch:    master

commit cbffac7df1deb106876b4fba1d481ce70bda9302
Author: Lee Yarwood <lyarwood@xxxxxxxxxx>
Date:   Wed Mar 4 11:56:53 2020 +0000

    functional: Avoid race and fix use of self.api within test_bug_1831771
    
    This test would previously only attempt to invoke a race between
    instance.save(expected_task_state=task_states.SPAWNING) and a parallel
    attempt to delete an instance when the instance also has a vm_state of
    ACTIVE and task_state of None. However vm_state and task_state would
    often be different within the test resulting in no attempt to invoke the
    test being made.
    
    As instance.save is only called with expected_task_state set to
    task_states.SPAWNING by _unshelve_instance and _build_and_run_instance
    we should just check for this and avoid any state races within the test.
    
    Additionally when attempting to invoke the race this test would call
    _wait_for_server_parameter and provide self.api. This change removes
    this argument as since I8c96b337f32148f8f5899c9b87af331b1fa41424 this is
    no longer required and will result in a `TypeError:
    'TestOpenStackClient' object is not subscriptable` error.
    
    Closes-Bug: #1866072
    Change-Id: I36da36cc5b099174eece0dfba29485fc20b2867b


** Changed in: nova
       Status: In Progress => Fix Released

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1866072

Title:
  TypeError: 'TestOpenStackClient' object is not subscriptable

Status in OpenStack Compute (nova):
  Fix Released

Bug description:
  Description
  ===========

  nova.tests.functional.regressions.test_bug_1831771.TestDelete.test_delete_during_create
  is often failing with the following trace:

  2020-03-03 09:32:17.177641 | ubuntu-bionic |     Traceback (most recent call last):
  2020-03-03 09:32:17.177668 | ubuntu-bionic |       File "/home/zuul/src/opendev.org/openstack/nova/nova/compute/manager.py", line 2196, in _do_build_and_run_instance
  2020-03-03 09:32:17.177688 | ubuntu-bionic |         filter_properties, request_spec)
  2020-03-03 09:32:17.177707 | ubuntu-bionic |       File "/home/zuul/src/opendev.org/openstack/nova/nova/compute/manager.py", line 2496, in _build_and_run_instance
  2020-03-03 09:32:17.177726 | ubuntu-bionic |         instance.save(expected_task_state=task_states.SPAWNING)
  2020-03-03 09:32:17.177745 | ubuntu-bionic |       File "/home/zuul/src/opendev.org/openstack/nova/nova/tests/functional/regressions/test_bug_1831771.py", line 67, in wrap_save
  2020-03-03 09:32:17.177776 | ubuntu-bionic |         delete_race(instance)
  2020-03-03 09:32:17.177797 | ubuntu-bionic |       File "/home/zuul/src/opendev.org/openstack/nova/nova/tests/functional/regressions/test_bug_1831771.py", line 37, in delete_race
  2020-03-03 09:32:17.177828 | ubuntu-bionic |         {'OS-EXT-STS:task_state': task_states.DELETING},
  2020-03-03 09:32:17.177864 | ubuntu-bionic |       File "/home/zuul/src/opendev.org/openstack/nova/nova/tests/functional/integrated_helpers.py", line 83, in _wait_for_server_parameter
  2020-03-03 09:32:17.177895 | ubuntu-bionic |         server = api.get_server(server['id'])
  2020-03-03 09:32:17.177929 | ubuntu-bionic |     TypeError: 'TestOpenStackClient' object is not subscriptable

  This appears to be as a result of
  https://review.opendev.org/#/c/697694/ *and* a race within the test
  resulting in the delete_race method above not always being used with
  each run of the test.

  Steps to reproduce
  ==================

  * $ tox -e functional-py36
  nova.tests.functional.regressions.test_bug_1831771.TestDelete.test_delete_during_create

  Expected result
  ===============

  delete_race should always run and the test should pass.

  Actual result
  =============

  delete_race either isn't called with the test then passing or it is
  and the test fails.

  
  Environment
  ===========
  1. Exact version of OpenStack you are running. See the following
    list for all releases: http://docs.openstack.org/releases/

     master - b3e14931d6aac6ee5776ce1e6974c75a5a6b1823

  2. Which hypervisor did you use?
     (For example: Libvirt + KVM, Libvirt + XEN, Hyper-V, PowerKVM, ...)
     What's the version of that?

     N/A

  2. Which storage type did you use?
     (For example: Ceph, LVM, GPFS, ...)
     What's the version of that?

     N/A

  3. Which networking type did you use?
     (For example: nova-network, Neutron with OpenVSwitch, ...)

     N/A

  Logs & Configs
  ==============

  https://zuul.opendev.org/t/openstack/build/b781ccf934894bf89cdeb13f58de1c5f/log
  /job-output.txt#4056

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/1866072/+subscriptions


References