Tuesday, 2020-03-03

*** tetsuro has joined #openstack-cyborg00:42
*** tetsuro has quit IRC00:47
*** tetsuro has joined #openstack-cyborg00:47
*** chenke has joined #openstack-cyborg01:48
*** Sundar has joined #openstack-cyborg01:50
SundarHi chenke01:50
chenkeHi01:50
chenkehttps://review.opendev.org/#/c/673735/40/nova/tests/unit/compute/test_compute_mgr.py01:50
chenkeDo your means Dan's advice will report error?01:51
SundarYes01:51
chenkeYou can write like this:https://github.com/openstack/cyborg/blob/acbc64f3bedc4f4946c5d12ea4fd7dc3d941667a/cyborg/tests/unit/db/test_db_device_profile.py#L85-L8701:51
SundarThat's what I did01:51
SundarIt fails saying it throws AcceleratorOp exception.01:52
SundarWhat 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
chenkeEmmm. Before that, I thought you were unfamiliar with the use of assertRaises, but it wasn't actually the problem.01:55
chenkeIt seems I still need to read the code carefully.01:56
Sundarok, np, thanks01:58
chenkeAbout line 6289,6290         with self.compute._build_resources(*args):02:02
chenkeI think you should delete this.02:02
chenkejust remove the line raise exception.NovaException.02:06
openstackgerritMerged openstack/cyborg master: Remove useless interfaces in cond  https://review.opendev.org/71055302:07
Sundarchenke:  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
chenkeI know. I means write like this: self.compute._build_resources(*args)02:23
chenkeI think then this method will raise  AcceleratorOp excepotion. And in line 6298 we can asertRaises(AcceleratorOp excepotion)02:25
SundarI tried it. It fails with: AssertionError: Expected 'delete_arqs_if_needed' to be called once. Called 0 times.02:32
SundarIOW, we need to raise an exception inside the with to force the delete_arqs_if_needed to be called.02:32
chenkeIf we comment lin3 6301, The ut will pass, right?02:40
chenkeDan's advice I think is to let you modify Line 6290 to use another exception instead of novaException which will confuse others.02:56
SundarI fixed it in a different way: http://paste.openstack.org/show/790224/03:47
chenkeOk04:24
*** Sundar has quit IRC04:25
chenkehttps://review.opendev.org/#/c/673735/40..41/nova/tests/unit/compute/test_compute_mgr.py@629304:28
*** Sundar has joined #openstack-cyborg04:28
chenkehttps://review.opendev.org/#/c/673735/40..41/nova/tests/unit/compute/test_compute_mgr.py@629304:28
SundarHi chenke04:29
chenkeI think this can write like this:04:29
chenkeremove try...except, just self.assertRaise(exception.BuildAbortException, self.compute._build_resources....)04:30
SundarHmm, let me try that04:30
chenkeok04:30
SundarFails 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
SundarThis is expected because _build_resources is a context manager04:34
SundarI think Dan is wrong with that advice04:34
SundarHere's my diff; http://paste.openstack.org/show/790226/04:37
SundarYou can also try it04:37
Sundarchenke: ^04:37
*** links has joined #openstack-cyborg04:38
*** igordc has joined #openstack-cyborg06:09
*** igordc has quit IRC06:13
chenkeThe paste diff result failed? right?06:29
*** brinzhang has joined #openstack-cyborg06:32
SundarYes, chenke06:35
*** brinzhang_ has joined #openstack-cyborg06:35
chenkeOk.06:35
chenkeThat's strange.06:36
chenkeIt's means self.compute._build_resources will not raise an exception?06:37
*** brinzhang has quit IRC06:38
*** brinzhang has joined #openstack-cyborg06:40
*** brinzhang has quit IRC06:41
*** brinzhang has joined #openstack-cyborg06:41
*** brinzhang_ has quit IRC06:43
*** brinzhang has quit IRC06:46
*** brinzhang has joined #openstack-cyborg06:46
*** brinzhang has quit IRC06:48
*** brinzhang has joined #openstack-cyborg06:49
chenkeSundar are you here?06:57
openstackgerritchenker proposed openstack/cyborg master: Remove useless interfaces in agent  https://review.opendev.org/71091106:57
*** brinzhang_ has joined #openstack-cyborg06:59
openstackgerritchenker proposed openstack/cyborg master: Remove useless interfaces in agent  https://review.opendev.org/71091107:00
*** brinzhang has quit IRC07:02
SundarYes, I am here, chenke07:07
chenkeCool07:07
chenkeIt's means self.compute._build_resources will not raise an exception?07:07
SundarJust saw your message above07:07
chenkeNP07:07
SundarYes, for a context manager decorated function, we need to invoke the exception inside the with body, to trigger the eception path inside the function07:08
chenkeOh.  Cool.07:08
chenkeThe latest patch seems UT passed.07:09
chenkeI will give +1 after dan's review.07:09
openstackgerritchenker proposed openstack/cyborg master: Remove useless interfaces in agent  https://review.opendev.org/71091107:12
openstackgerritMerged openstack/cyborg master: move setting to devstack/settings  https://review.opendev.org/70877007:14
openstackgerritchenker proposed openstack/cyborg master: Remove useless interfaces in agent  https://review.opendev.org/71091107:18
SundarSure. Thanks, chenke.07:26
chenke:)07:27
SundarGoing to sleep now. Talk to you later. Have a good day. Bye!07:34
*** Sundar has quit IRC07:34
*** brinzhang has joined #openstack-cyborg08:47
*** brinzhang has quit IRC08:49
*** chenke has quit IRC08:49
*** brinzhang has joined #openstack-cyborg08:49
*** brinzhang_ has quit IRC08:50
*** brinzhang has quit IRC08:51
*** brinzhang has joined #openstack-cyborg08:52
*** brinzhang has quit IRC08:53
*** brinzhang has joined #openstack-cyborg08:54
*** FlorianFa has quit IRC09:05
*** brinzhang_ has joined #openstack-cyborg10:11
*** brinzhang has quit IRC10:15
*** brinzhang has joined #openstack-cyborg10:24
*** brinzhang_ has quit IRC10:27
*** brinzhang_ has joined #openstack-cyborg10:42
*** brinzhang_ has quit IRC10:43
*** brinzhang_ has joined #openstack-cyborg10:44
*** brinzhang has quit IRC10:45
*** brinzhang_ has quit IRC10:45
*** brinzhang_ has joined #openstack-cyborg10:46
*** zhipeng has quit IRC10:57
*** openstackstatus has quit IRC10:59
*** brinzhang has joined #openstack-cyborg11:01
*** brinzhang_ has quit IRC11:03
*** tetsuro has quit IRC11:57
*** brinzhang has quit IRC12:21
*** brinzhang has joined #openstack-cyborg12:22
*** brinzhang_ has joined #openstack-cyborg12:26
*** brinzhang has quit IRC12:29
*** brinzhang has joined #openstack-cyborg13:03
*** brinzhang_ has quit IRC13:06
*** brinzhang_ has joined #openstack-cyborg13:17
*** links has quit IRC14:05
*** links has joined #openstack-cyborg14:37
*** links has quit IRC14:37
*** brinzhang has quit IRC14:39
*** brinzhang has joined #openstack-cyborg14:40
*** brinzhang_ has quit IRC15:11
*** brinzhang_ has joined #openstack-cyborg16:29
*** brinzhang has quit IRC16:32
openstackgerritDan Smith proposed openstack/cyborg master: WIP add cyborg multinode job  https://review.opendev.org/70964117:10
*** brinzhang has joined #openstack-cyborg17:19
*** brinzhang_ has quit IRC17:22
*** igordc has joined #openstack-cyborg17:59
*** igordc has quit IRC21:08
*** igordc has joined #openstack-cyborg21:08
*** igordc has quit IRC21:10
*** TxGirlGeek has joined #openstack-cyborg21:11
*** igordc has joined #openstack-cyborg21:12
*** igordc has quit IRC21:12
*** brinzhang_ has joined #openstack-cyborg22:42
*** brinzhang has quit IRC22:45
*** brinzhang has joined #openstack-cyborg23:33
*** brinzhang_ has quit IRC23:36

Generated by irclog2html.py 2.15.3 by Marius Gedminas - find it at mg.pov.lt!