Earlier  
Posted Nick Remark
#openstack-nova - 2023-06-29
18:06:50 dvo-plv def test_resize_virtio_packed_ring_image_flavor_conflict(self):
18:06:50 dvo-plv """Ensure that packed_virtqueue_filter filter will reject resize
18:06:50 dvo-plv due to image property and flavor extra spec conflict
18:06:50 dvo-plv """
18:06:50 dvo-plv # Decorate compute 1 and compute2 resource provider with trait.
18:06:52 dvo-plv rp_uuid1 = self._get_provider_uuid_by_host(self.compute1.host)
18:06:53 dvo-plv rp_uuid2 = self._get_provider_uuid_by_host(self.compute2.host)
18:06:55 dvo-plv self._set_provider_traits(rp_uuid1, ['COMPUTE_NET_VIRTIO_PACKED'])
18:06:57 dvo-plv self._set_provider_traits(rp_uuid2, ['COMPUTE_NET_VIRTIO_PACKED'])
18:06:59 dvo-plv # Create image with enabled Virtio Packed Ring property
18:07:01 dvo-plv image = self._create_image(metadata={'hw_virtio_packed_ring': 'true'})
18:07:03 dvo-plv flavor_id = self._create_flavor(extra_spec={})
18:07:05 dvo-plv # Create server using only image with property
18:07:07 dvo-plv server = self._create_server(flavor_id=flavor_id,
18:07:09 dvo-plv image_uuid=image['id'],
18:07:11 dvo-plv expected_state='ACTIVE',
18:07:13 dvo-plv networks='none')
18:07:16 melwitt please use pastebin for pastes 😆
18:07:16 melwitt please use pastebin for pastes 😆
18:07:17 dvo-plv server = self._wait_for_state_change(server, 'ACTIVE')
18:07:19 dvo-plv # Create flavor with disabled Virtio Packed Ring in the extra spec
18:07:21 dvo-plv new_flavor_id = self._create_flavor(extra_spec={'hw:virtio_packed_ring': 'false'})
18:07:23 dvo-plv import rpdb
18:07:25 dvo-plv debugger = rpdb.Rpdb(port=12345)
18:07:27 dvo-plv debugger.set_trace()
18:07:29 dvo-plv ex = self.assertRaises(exception.FlavorImageConflict, self._resize_server, server, new_flavor_id)
18:09:09 dvo-plv https://paste.opendev.org/show/bD8BWCnpsUY8Rr7c6Hc7/
18:10:01 dvo-plv I implemented this test here
18:10:05 dvo-plv (functional) stack@server72:/opt/stack/nova$ tox -e functional -- nova.tests.functional.test_servers.TraitsBasedSchedulingTest.test_resize_virtio_packed_ring_image_flavor_conflict
18:13:32 melwitt oh, right sorry 😣 bc this is a func test you will rather have to look at the returned http status code and message. sec
18:13:32 melwitt oh, right sorry 😣 bc this is a func test you will rather have to look at the returned http status code and message. sec
18:14:38 dvo-plv I saw this option in the other examples
18:14:39 dvo-plv self.assertEqual(403, ex.response.status_code)
18:14:50 dvo-plv but i can not get status code
18:17:27 dvo-plv https://paste.opendev.org/show/bOdkEFYHa3h24nBD5Ws1/
18:17:30 dvo-plv this is test output
18:17:33 melwitt yeah, I think you can't use the _resize_server helper function in this case bc it will only return you the server object and bc it will wait for expected notifications https://github.com/openstack/nova/blob/master/nova/tests/functional/integrated_helpers.py#L530 which are not all going to happen in your case
18:17:54 melwitt since you're testing for an error condition
18:19:12 melwitt so you'll want to unwrap that i.e. call self.api.post_server_action directly, like this https://github.com/openstack/nova/blob/master/nova/tests/functional/test_servers.py#L347
18:19:22 dvo-plv I see, I will try to figure out without this wrapper, thank you
18:22:27 melwitt in the func tests the error exception will always be client.OpenStackApiException with the details encapsulated inside of it as it's imitating a rest API caller who will receive only an error from the client, not the internal exception that nova raised
18:25:19 dvo-plv okay, I believe it will help me, thank you
18:54:23 dvo-plv maybe I need something else for my case ?
18:54:59 dvo-plv I updated my test in this way
18:54:59 dvo-plv https://paste.opendev.org/show/bXTsHeFs7ct1qOUcLg1r/
18:55:11 dvo-plv But i get this error testtools.matchers._impl.MismatchError: <bound method TestOpenStackClient.post_server_action of <nova.tests.functional.api.client.TestOpenStackClient object at 0x7f7b4fe13b50>> returned {}
18:55:33 dvo-plv (Pdb) self.api.post_server_action(server['id'], {'resize': {'flavorRef': new_flavor_id}})
18:55:34 dvo-plv {}
19:00:24 dvo-plv It does not call class Fault(webob.exc.HTTPException) fault names
19:02:01 melwitt dvo-plv: that means that when you requested the resize you got a http status OK and you were expecting probably a 409 or? if your code is supposed to raise a conflict/409 to the rest API caller, there may be a bug with the exception not propagating up to the API
19:02:14 melwitt *you may have a bug
19:02:40 dvo-plv yes, look like it does not call status code from this class 409: "conflictingRequest",
19:02:47 dvo-plv class Fault(webob.exc.HTTPException):
19:04:50 melwitt yeah so you'll want to debug and trace from where you raise exception.FlavorImageConflict up to the API and find where it's not being propagated up
19:05:38 melwitt (again, if your intended behavior is a http 409 returned to the rest API caller)
#openstack-nova - 2023-06-30
08:13:50 opendevreview Yamato Tanaka proposed openstack/python-novaclient master: Do exact-matching when finding one instance by name https://review.opendev.org/c/openstack/python-novaclient/+/887268
08:20:48 opendevreview Alexey Stupnikov proposed openstack/nova master: Add functional tests to reproduce bug #1994983 https://review.opendev.org/c/openstack/nova/+/863416
08:35:39 opendevreview Guillaume Espanel proposed openstack/nova master: Skip useless qemu-img convert when snapshotting https://review.opendev.org/c/openstack/nova/+/851854
08:50:33 opendevreview Guillaume Espanel proposed openstack/nova master: Skip useless qemu-img convert when snapshotting https://review.opendev.org/c/openstack/nova/+/851854
09:45:31 opendevreview Amit Uniyal proposed openstack/nova-specs master: Adds cleanup to remove dangling volumes https://review.opendev.org/c/openstack/nova-specs/+/878757
09:52:09 opendevreview Arnaud Morin proposed openstack/nova stable/2023.1: Unbind port when offloading a shelved instance https://review.opendev.org/c/openstack/nova/+/887183
12:10:04 opendevreview Alexey Stupnikov proposed openstack/nova master: Add functional tests to reproduce bug #1994983 https://review.opendev.org/c/openstack/nova/+/863416
13:44:02 opendevreview Alexey Stupnikov proposed openstack/nova master: Log some InstanceNotFound exceptions from libvirt https://review.opendev.org/c/openstack/nova/+/863665
13:53:34 opendevreview Alexey Stupnikov proposed openstack/nova master: Add functional tests to reproduce bug #1994983 https://review.opendev.org/c/openstack/nova/+/863416
15:22:35 opendevreview Alexey Stupnikov proposed openstack/nova master: Log some InstanceNotFound exceptions from libvirt https://review.opendev.org/c/openstack/nova/+/863665
17:38:57 dvo-plv sean-k-mooney, Hello
17:39:04 dvo-plv are you here ?
#openstack-nova - 2023-07-01
13:58:31 opendevreview Amit Uniyal proposed openstack/nova master: Delete dangling bdms https://review.opendev.org/c/openstack/nova/+/882284
14:50:46 opendevreview Arnaud Morin proposed openstack/nova master: Correctly reset instance task state in rebooting hard https://review.opendev.org/c/openstack/nova/+/867832
#openstack-nova - 2023-07-02
08:08:57 opendevreview Merged openstack/nova master: database: Archive parent and child rows "trees" one at a time https://review.opendev.org/c/openstack/nova/+/877056
#openstack-nova - 2023-07-03
08:27:37 dvo-plv sean-k-mooney, Hello, are you around today ?
08:48:45 dvo-plv melwitt, Hello
09:41:55 elodilles if any core wants to do a trivial review for a bot generated patch, then here is a nice candidate: https://review.opendev.org/c/openstack/osc-placement/+/875100
09:42:17 elodilles o:) (this should have merged months ago)
09:51:16 sean-k-mooney done
09:51:20 sean-k-mooney dvo-plv: o/
09:52:34 dvo-plv I have a question regarding your comment with implementing functional tests
09:52:35 dvo-plv https://review.opendev.org/c/openstack/nova/+/876075/14/nova/scheduler/request_filter.py#285
09:53:13 sean-k-mooney sure
09:53:26 sean-k-mooney whats specifically
09:54:37 dvo-plv I had rewrite this method to catch conflict in this way https://paste.opendev.org/show/bzaJaNk53E0OX9otfzzI/
09:55:21 dvo-plv but during the process of creating http response i caught next error
09:55:22 dvo-plv https://paste.opendev.org/show/bd8oaO0EfYznOP5gkACa/
09:55:27 sean-k-mooney why
09:56:18 sean-k-mooney oh the dict interfnace for nova/oslo verions objects has been deprecated for years
09:56:28 sean-k-mooney we started revmign all the supprot a while a go
09:56:29 dvo-plv to handle this issue in the test
09:57:00 dvo-plv so my question is, how should i properly solve this issue
09:57:21 dvo-plv implement this to_dict method, or leave it with a comment?
09:57:35 sean-k-mooney neither
09:57:41 sean-k-mooney why is to_dict being called
09:58:35 sean-k-mooney im not sure why you are doing the rewite
09:58:38 sean-k-mooney it should not be required
09:59:23 dvo-plv https://paste.opendev.org/show/blwO5HpbmFyV7UP3Gppk/
09:59:50 dvo-plv this is how I impolemnted this test
10:00:13 dvo-plv and it fails as expected, so I add this mock @unittest.expectedFailure
10:00:32 sean-k-mooney we dont normaly use that decorator
10:00:41 dvo-plv But folks comfirmed that I should not use it here, because this mock only for bugs
10:00:58 sean-k-mooney we use an expict assert
10:01:47 sean-k-mooney i.e. self.assertRaises(<excption_class>, <function>, *args, **kwargs)

Earlier   Later