| Posted | Nick | Remark | |
|---|---|---|---|
| #openstack-nova - 2023-06-29 | |||
| 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) | |
| 10:04:40 | dvo-plv | Yes, I already tried this and disscuse it with melwitt | |
| 10:04:43 | dvo-plv | <dvo-plv> I alredy tried this way | |
| 10:04:43 | dvo-plv | <dvo-plv> (Pdb) ex = self.assertRaises(exception.FlavorImageConflict,self._resize_server,server,new_flavor_id) | |
| 10:04:43 | dvo-plv | <dvo-plv> *** AssertionError: Notification instance.resize.end hasn't been received. Received: | |
| 10:05:23 | sean-k-mooney | https://github.com/openstack/nova/blob/master/nova/tests/functional/libvirt/test_numa_servers.py#L643-L713 is an example fo a resize test | |
| 10:05:37 | sean-k-mooney | in your case you need to tell self._resize_server | |
| 10:05:41 | sean-k-mooney | to expect it to fail | |
| 10:06:01 | opendevreview | Merged openstack/osc-placement master: Update master for stable/2023.1 https://review.opendev.org/c/openstack/osc-placement/+/875100 | |
| 10:06:58 | sean-k-mooney | https://github.com/openstack/nova/blob/4b454febf73cdd7b5be0a2dad272c1d7685fac9e/nova/tests/functional/integrated_helpers.py#L527-L531 | |
| 10:07:14 | sean-k-mooney | so the current helpe expect to get to verify reize | |
| 10:07:58 | sean-k-mooney | in this case your expecting to get a api error directly right | |
| 10:08:09 | sean-k-mooney | so you will have to just do the post directly | |
| 10:08:13 | sean-k-mooney | self.api.post_server_action( | |
| 10:08:15 | sean-k-mooney | server['id'], {'resize': {'flavorRef': flavor_id}}) | |
| 10:09:27 | sean-k-mooney | like this https://github.com/openstack/nova/blob/4b454febf73cdd7b5be0a2dad272c1d7685fac9e/nova/tests/functional/test_servers.py#L808-L818 | |
| 10:10:53 | sean-k-mooney | actully def test_resize_server_negative_invalid_state(self): is kind of a good exampel for you to use as a reference in general | |
| 10:11:13 | dvo-plv | This way also was tested | |
| 10:11:14 | dvo-plv | <dvo-plv> (Pdb) self.api.post_server_action(server['id'], {'resize': {'flavorRef': new_flavor_id}}) | |
| 10:11:14 | dvo-plv | <dvo-plv> {} | |
| 10:11:14 | dvo-plv | <dvo-plv> It does not call class Fault(webob.exc.HTTPException) fault names | |
| 10:12:23 | dvo-plv | In this test, which can be reference, it wait for 409 error and verify it here self.assertEqual(409, ex.response.status_code) | |
| 10:13:06 | dvo-plv | So I belive that I also need to extend FlavorImageConflict with error code 409 and catch it in the test | |
| 10:13:18 | sean-k-mooney | no you dont | |
| 10:13:29 | sean-k-mooney | FlavorImageConflict already resultes in a 409 | |
| 10:14:29 | dvo-plv | https://github.com/openstack/nova/blob/master/nova/exception.py#L2341 | |
| 10:14:34 | sean-k-mooney | oh it default to a 500 | |
| 10:14:55 | dvo-plv | I did not found it here, so I thought that I need to extend it | |
| 10:14:58 | sean-k-mooney | but it should be converted elsewhere to a 400 or 409 | |
| 10:15:31 | sean-k-mooney | https://github.com/openstack/nova/blob/master/nova/exception.py#L67 | |
| 10:16:14 | dvo-plv | So, all this changes is not required to raise http conflict ? https://paste.opendev.org/show/bzaJaNk53E0OX9otfzzI/ | |
| 10:16:27 | dvo-plv | It should handle is some other way ? | |
| 10:16:28 | sean-k-mooney | it is part of INVALID_FLAVOR_IMAGE_EXCEPTIONS https://github.com/openstack/nova/blob/4b454febf73cdd7b5be0a2dad272c1d7685fac9e/nova/api/openstack/compute/servers.py#L58 | |
| 10:17:06 | sean-k-mooney | and that gets converted to a 400 bad reuest for resize here https://github.com/openstack/nova/blob/4b454febf73cdd7b5be0a2dad272c1d7685fac9e/nova/api/openstack/compute/servers.py#L1086-L1087 | |
| 10:18:01 | sean-k-mooney | so if you copy test_resize_server_negative_invalid_state and update it with the logic form your test and assert a 400 is retured then that should work | |
| 10:19:02 | sean-k-mooney | so duplicate https://github.com/openstack/nova/blob/4b454febf73cdd7b5be0a2dad272c1d7685fac9e/nova/tests/functional/test_servers.py#L792C9-L821 and update it image/flavor infor required for your test case | |
| 10:19:20 | dvo-plv | Okay, I will try to use it as template now | |
| 10:19:22 | sean-k-mooney | you shoudl get back a client.OpenStackApiException with reponce code 400 | |
| 10:19:24 | dvo-plv | thank you | |
| 10:20:08 | sean-k-mooney | ok i need to step away for a bit and pick up a collegue form there house | |
| 10:20:12 | sean-k-mooney | ill be back later | |
| 11:16:45 | dvo-plv | sean-k-mooney, I have rewrote test in the next way and I still get the same empty response | |
| 11:16:46 | dvo-plv | https://paste.opendev.org/show/bSbVh7CP0oKa1eQdVNUj/ | |