Reviewed: https://review.openstack.org/561190 Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=5c98984bb6e7912a9074a715148db94ce06db444 Submitter: Zuul Branch: master
commit 5c98984bb6e7912a9074a715148db94ce06db444 Author: Stephen Finucane <sfinu...@redhat.com> Date: Fri Apr 13 11:29:55 2018 +0100 tests: Fix how context managers are mocked Two issues here: - The mock library provides a 'mock_open' function to mock the 'open' builtin's context manager. We should have been using this but were not. - We were mocking another context manager in a fairly strange way. This seems to be causing issues, possibly down to race. We shouldn't do that. Fix both issues. Change-Id: I289b56ae3f9ccd16d72b2ca317e68e6c18b8b313 Fixes-Bug: #1763535 ** Changed in: nova Status: Confirmed => 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/1763535 Title: nova.tests.unit.virt.xenapi.test_vm_utils.StreamDiskTestCase.test_non_ami intermittently fails Status in OpenStack Compute (nova): Fix Released Bug description: http://logs.openstack.org/78/554378/3/check/openstack-tox-py27/54b38c0 /job-output.txt.gz#_2018-04-12_21_06_12_011559 2018-04-12 21:06:12.011559 | ubuntu-xenial | {5} nova.tests.unit.virt.xenapi.test_vm_utils.StreamDiskTestCase.test_non_ami [0.029729s] ... FAILED 2018-04-12 21:06:12.011603 | ubuntu-xenial | 2018-04-12 21:06:12.011667 | ubuntu-xenial | Captured traceback: 2018-04-12 21:06:12.011728 | ubuntu-xenial | ~~~~~~~~~~~~~~~~~~~ 2018-04-12 21:06:12.011819 | ubuntu-xenial | Traceback (most recent call last): 2018-04-12 21:06:12.012090 | ubuntu-xenial | File "/home/zuul/src/git.openstack.org/openstack/nova/.tox/py27/local/lib/python2.7/site-packages/mock/mock.py", line 1305, in patched 2018-04-12 21:06:12.012184 | ubuntu-xenial | return func(*args, **keywargs) 2018-04-12 21:06:12.012351 | ubuntu-xenial | File "nova/tests/unit/virt/xenapi/test_vm_utils.py", line 1213, in test_non_ami 2018-04-12 21:06:12.012458 | ubuntu-xenial | vm_utils.ImageType.KERNEL, None, 'dev') 2018-04-12 21:06:12.012598 | ubuntu-xenial | File "nova/virt/xenapi/vm_utils.py", line 2266, in _stream_disk 2018-04-12 21:06:12.012700 | ubuntu-xenial | with utils.temporary_chown(dev_path): 2018-04-12 21:06:12.012839 | ubuntu-xenial | File "/usr/lib/python2.7/contextlib.py", line 19, in __enter__ 2018-04-12 21:06:12.012952 | ubuntu-xenial | raise RuntimeError("generator didn't yield") 2018-04-12 21:06:12.013045 | ubuntu-xenial | RuntimeError: generator didn't yield 2018-04-12 21:06:12.013080 | ubuntu-xenial | http://logstash.openstack.org/#dashboard/file/logstash.json?query=message%3A%5C%22vm_utils.ImageType.KERNEL%2C%20None%2C%20'dev')%5C%22%20AND%20tags%3A%5C%22console%5C%22&from=7d 20 hits in 7 days, check and gate, all failures. Looks like maybe this started around 4/11. To manage notifications about this bug go to: https://bugs.launchpad.net/nova/+bug/1763535/+subscriptions -- Mailing list: https://launchpad.net/~yahoo-eng-team Post to : yahoo-eng-team@lists.launchpad.net Unsubscribe : https://launchpad.net/~yahoo-eng-team More help : https://help.launchpad.net/ListHelp