← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1848147] Re: not mocking openstacksdk exception may cause random non detected errors in unit tests

 

Reviewed:  https://review.opendev.org/688439
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=dce7af902c4207dcaa062eef7a21da2017fb37c7
Submitter: Zuul
Branch:    master

commit dce7af902c4207dcaa062eef7a21da2017fb37c7
Author: Riccardo Pittau <elfosardo@xxxxxxxxx>
Date:   Mon Oct 14 17:12:33 2019 +0200

    Mock openstacksdk raise_from_response in ironic unit test
    
    Mocking the openstacksdk exception method raise_from_response
    to prevent random error messages even in succeded unit
    tests.
    An example:
    https://zuul.opendev.org/t/openstack/build/943c3f89519c44a58e0b5c86ad4efff8/log/job-output.txt#23782-23789
    
    Change-Id: I3d9128d6712b4094c0b2ad7e12db9e5a915e3d91
    Closes-Bug: #1848147


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

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1848147

Title:
  not mocking openstacksdk exception may cause random non detected
  errors in unit tests

Status in neutron:
  Fix Released

Bug description:
  Recently added change to ironic notifier plugin migrated the client connection from ironicclient to openstacksdk. The change in the unit tests didn't take into consideration that the openstacksdk exceptions method raise_from_response evaluates the response code as int and this may cause random errors bypassed during tests.
  An example can be seen here:
  https://zuul.opendev.org/t/openstack/build/943c3f89519c44a58e0b5c86ad4efff8/log/job-output.txt#23782-23789

  Important note:
  this bug doesn't affect any operational part of the code but just the unit tests.

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


References