*** tetsuro has joined #openstack-cyborg | 00:42 | |
*** tetsuro has quit IRC | 00:47 | |
*** tetsuro has joined #openstack-cyborg | 00:47 | |
*** chenke has joined #openstack-cyborg | 01:48 | |
*** Sundar has joined #openstack-cyborg | 01:50 | |
Sundar | Hi chenke | 01:50 |
---|---|---|
chenke | Hi | 01:50 |
chenke | https://review.opendev.org/#/c/673735/40/nova/tests/unit/compute/test_compute_mgr.py | 01:50 |
chenke | Do your means Dan's advice will report error? | 01:51 |
Sundar | Yes | 01:51 |
chenke | You can write like this:https://github.com/openstack/cyborg/blob/acbc64f3bedc4f4946c5d12ea4fd7dc3d941667a/cyborg/tests/unit/db/test_db_device_profile.py#L85-L87 | 01:51 |
Sundar | That's what I did | 01:51 |
Sundar | It fails saying it throws AcceleratorOp exception. | 01:52 |
Sundar | What is wrong with the current test? I am not trying to check that the code raises an exception. But the test case mocking will force an exception. So, we shouldn't need to assert for that. | 01:53 |
chenke | Emmm. Before that, I thought you were unfamiliar with the use of assertRaises, but it wasn't actually the problem. | 01:55 |
chenke | It seems I still need to read the code carefully. | 01:56 |
Sundar | ok, np, thanks | 01:58 |
chenke | About line 6289,6290 with self.compute._build_resources(*args): | 02:02 |
chenke | I think you should delete this. | 02:02 |
chenke | just remove the line raise exception.NovaException. | 02:06 |
openstackgerrit | Merged openstack/cyborg master: Remove useless interfaces in cond https://review.opendev.org/710553 | 02:07 |
Sundar | chenke: self.compute._build_resources is a context manager.When an exception is thrown inside the with statement, that causes a specific code path inside _build_resources_, which is where AcceleratorOp excepotion gets raised. | 02:22 |
chenke | I know. I means write like this: self.compute._build_resources(*args) | 02:23 |
chenke | I think then this method will raise AcceleratorOp excepotion. And in line 6298 we can asertRaises(AcceleratorOp excepotion) | 02:25 |
Sundar | I tried it. It fails with: AssertionError: Expected 'delete_arqs_if_needed' to be called once. Called 0 times. | 02:32 |
Sundar | IOW, we need to raise an exception inside the with to force the delete_arqs_if_needed to be called. | 02:32 |
chenke | If we comment lin3 6301, The ut will pass, right? | 02:40 |
chenke | Dan's advice I think is to let you modify Line 6290 to use another exception instead of novaException which will confuse others. | 02:56 |
Sundar | I fixed it in a different way: http://paste.openstack.org/show/790224/ | 03:47 |
chenke | Ok | 04:24 |
*** Sundar has quit IRC | 04:25 | |
chenke | https://review.opendev.org/#/c/673735/40..41/nova/tests/unit/compute/test_compute_mgr.py@6293 | 04:28 |
*** Sundar has joined #openstack-cyborg | 04:28 | |
chenke | https://review.opendev.org/#/c/673735/40..41/nova/tests/unit/compute/test_compute_mgr.py@6293 | 04:28 |
Sundar | Hi chenke | 04:29 |
chenke | I think this can write like this: | 04:29 |
chenke | remove try...except, just self.assertRaise(exception.BuildAbortException, self.compute._build_resources....) | 04:30 |
Sundar | Hmm, let me try that | 04:30 |
chenke | ok | 04:30 |
Sundar | Fails with: testtools.matchers._impl.MismatchError: <bound method ComputeManager._build_resources of <nova.compute.manager.ComputeManager object at 0x7f3f25852a90>> returned <contextlib._GeneratorContextManager object at 0x7f3f2521fb00> | 04:34 |
Sundar | This is expected because _build_resources is a context manager | 04:34 |
Sundar | I think Dan is wrong with that advice | 04:34 |
Sundar | Here's my diff; http://paste.openstack.org/show/790226/ | 04:37 |
Sundar | You can also try it | 04:37 |
Sundar | chenke: ^ | 04:37 |
*** links has joined #openstack-cyborg | 04:38 | |
*** igordc has joined #openstack-cyborg | 06:09 | |
*** igordc has quit IRC | 06:13 | |
chenke | The paste diff result failed? right? | 06:29 |
*** brinzhang has joined #openstack-cyborg | 06:32 | |
Sundar | Yes, chenke | 06:35 |
*** brinzhang_ has joined #openstack-cyborg | 06:35 | |
chenke | Ok. | 06:35 |
chenke | That's strange. | 06:36 |
chenke | It's means self.compute._build_resources will not raise an exception? | 06:37 |
*** brinzhang has quit IRC | 06:38 | |
*** brinzhang has joined #openstack-cyborg | 06:40 | |
*** brinzhang has quit IRC | 06:41 | |
*** brinzhang has joined #openstack-cyborg | 06:41 | |
*** brinzhang_ has quit IRC | 06:43 | |
*** brinzhang has quit IRC | 06:46 | |
*** brinzhang has joined #openstack-cyborg | 06:46 | |
*** brinzhang has quit IRC | 06:48 | |
*** brinzhang has joined #openstack-cyborg | 06:49 | |
chenke | Sundar are you here? | 06:57 |
openstackgerrit | chenker proposed openstack/cyborg master: Remove useless interfaces in agent https://review.opendev.org/710911 | 06:57 |
*** brinzhang_ has joined #openstack-cyborg | 06:59 | |
openstackgerrit | chenker proposed openstack/cyborg master: Remove useless interfaces in agent https://review.opendev.org/710911 | 07:00 |
*** brinzhang has quit IRC | 07:02 | |
Sundar | Yes, I am here, chenke | 07:07 |
chenke | Cool | 07:07 |
chenke | It's means self.compute._build_resources will not raise an exception? | 07:07 |
Sundar | Just saw your message above | 07:07 |
chenke | NP | 07:07 |
Sundar | Yes, for a context manager decorated function, we need to invoke the exception inside the with body, to trigger the eception path inside the function | 07:08 |
chenke | Oh. Cool. | 07:08 |
chenke | The latest patch seems UT passed. | 07:09 |
chenke | I will give +1 after dan's review. | 07:09 |
openstackgerrit | chenker proposed openstack/cyborg master: Remove useless interfaces in agent https://review.opendev.org/710911 | 07:12 |
openstackgerrit | Merged openstack/cyborg master: move setting to devstack/settings https://review.opendev.org/708770 | 07:14 |
openstackgerrit | chenker proposed openstack/cyborg master: Remove useless interfaces in agent https://review.opendev.org/710911 | 07:18 |
Sundar | Sure. Thanks, chenke. | 07:26 |
chenke | :) | 07:27 |
Sundar | Going to sleep now. Talk to you later. Have a good day. Bye! | 07:34 |
*** Sundar has quit IRC | 07:34 | |
*** brinzhang has joined #openstack-cyborg | 08:47 | |
*** brinzhang has quit IRC | 08:49 | |
*** chenke has quit IRC | 08:49 | |
*** brinzhang has joined #openstack-cyborg | 08:49 | |
*** brinzhang_ has quit IRC | 08:50 | |
*** brinzhang has quit IRC | 08:51 | |
*** brinzhang has joined #openstack-cyborg | 08:52 | |
*** brinzhang has quit IRC | 08:53 | |
*** brinzhang has joined #openstack-cyborg | 08:54 | |
*** FlorianFa has quit IRC | 09:05 | |
*** brinzhang_ has joined #openstack-cyborg | 10:11 | |
*** brinzhang has quit IRC | 10:15 | |
*** brinzhang has joined #openstack-cyborg | 10:24 | |
*** brinzhang_ has quit IRC | 10:27 | |
*** brinzhang_ has joined #openstack-cyborg | 10:42 | |
*** brinzhang_ has quit IRC | 10:43 | |
*** brinzhang_ has joined #openstack-cyborg | 10:44 | |
*** brinzhang has quit IRC | 10:45 | |
*** brinzhang_ has quit IRC | 10:45 | |
*** brinzhang_ has joined #openstack-cyborg | 10:46 | |
*** zhipeng has quit IRC | 10:57 | |
*** openstackstatus has quit IRC | 10:59 | |
*** brinzhang has joined #openstack-cyborg | 11:01 | |
*** brinzhang_ has quit IRC | 11:03 | |
*** tetsuro has quit IRC | 11:57 | |
*** brinzhang has quit IRC | 12:21 | |
*** brinzhang has joined #openstack-cyborg | 12:22 | |
*** brinzhang_ has joined #openstack-cyborg | 12:26 | |
*** brinzhang has quit IRC | 12:29 | |
*** brinzhang has joined #openstack-cyborg | 13:03 | |
*** brinzhang_ has quit IRC | 13:06 | |
*** brinzhang_ has joined #openstack-cyborg | 13:17 | |
*** links has quit IRC | 14:05 | |
*** links has joined #openstack-cyborg | 14:37 | |
*** links has quit IRC | 14:37 | |
*** brinzhang has quit IRC | 14:39 | |
*** brinzhang has joined #openstack-cyborg | 14:40 | |
*** brinzhang_ has quit IRC | 15:11 | |
*** brinzhang_ has joined #openstack-cyborg | 16:29 | |
*** brinzhang has quit IRC | 16:32 | |
openstackgerrit | Dan Smith proposed openstack/cyborg master: WIP add cyborg multinode job https://review.opendev.org/709641 | 17:10 |
*** brinzhang has joined #openstack-cyborg | 17:19 | |
*** brinzhang_ has quit IRC | 17:22 | |
*** igordc has joined #openstack-cyborg | 17:59 | |
*** igordc has quit IRC | 21:08 | |
*** igordc has joined #openstack-cyborg | 21:08 | |
*** igordc has quit IRC | 21:10 | |
*** TxGirlGeek has joined #openstack-cyborg | 21:11 | |
*** igordc has joined #openstack-cyborg | 21:12 | |
*** igordc has quit IRC | 21:12 | |
*** brinzhang_ has joined #openstack-cyborg | 22:42 | |
*** brinzhang has quit IRC | 22:45 | |
*** brinzhang has joined #openstack-cyborg | 23:33 | |
*** brinzhang_ has quit IRC | 23:36 |
Generated by irclog2html.py 2.15.3 by Marius Gedminas - find it at mg.pov.lt!