)]}'
{"nova/tests/functional/regressions/test_bug_1781286.py":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"2273dc4b39abd768b256c2946c08a1444393cd98","unresolved":false,"context_lines":[{"line_number":131,"context_line":"        def wrap_prep_resize(*args, **kwargs):"},{"line_number":132,"context_line":"            # Poison the AZ query to blow up as if the cell conductor does not"},{"line_number":133,"context_line":"            # have access to the API DB."},{"line_number":134,"context_line":"            self.useFixture("},{"line_number":135,"context_line":"                fixtures.MockPatch("},{"line_number":136,"context_line":"                    \u0027nova.objects.AggregateList.get_by_host\u0027,"},{"line_number":137,"context_line":"                    side_effect\u003doslo_db_exc.CantStartEngineError))"}],"source_content_type":"text/x-python","patch_set":2,"id":"3fa7e38b_053fdeb5","line":134,"updated":"2019-10-02 13:15:02.000000000","message":"we could use a mock.patch context manager here and by that avoid the need of mock.path.stopall() call in the bugfix patch.","commit_id":"d40023235f5d6fac646f3e535b7afe1f03c832df"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"a53aa2b10881df9cdd470bd9a2baab90b99b7323","unresolved":false,"context_lines":[{"line_number":131,"context_line":"        def wrap_prep_resize(*args, **kwargs):"},{"line_number":132,"context_line":"            # Poison the AZ query to blow up as if the cell conductor does not"},{"line_number":133,"context_line":"            # have access to the API DB."},{"line_number":134,"context_line":"            self.useFixture("},{"line_number":135,"context_line":"                fixtures.MockPatch("},{"line_number":136,"context_line":"                    \u0027nova.objects.AggregateList.get_by_host\u0027,"},{"line_number":137,"context_line":"                    side_effect\u003doslo_db_exc.CantStartEngineError))"}],"source_content_type":"text/x-python","patch_set":2,"id":"3fa7e38b_6517b253","line":134,"in_reply_to":"3fa7e38b_053fdeb5","updated":"2019-10-02 13:55:25.000000000","message":"As replied in the other change I\u0027m not sure that\u0027s possible with how this works and what I\u0027m trying to recreate.","commit_id":"d40023235f5d6fac646f3e535b7afe1f03c832df"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"af42e8e2d2f70b6fb877b886837ee3ea8def147e","unresolved":false,"context_lines":[{"line_number":131,"context_line":"        def wrap_prep_resize(*args, **kwargs):"},{"line_number":132,"context_line":"            # Poison the AZ query to blow up as if the cell conductor does not"},{"line_number":133,"context_line":"            # have access to the API DB."},{"line_number":134,"context_line":"            self.useFixture("},{"line_number":135,"context_line":"                fixtures.MockPatch("},{"line_number":136,"context_line":"                    \u0027nova.objects.AggregateList.get_by_host\u0027,"},{"line_number":137,"context_line":"                    side_effect\u003doslo_db_exc.CantStartEngineError))"}],"source_content_type":"text/x-python","patch_set":2,"id":"3fa7e38b_b0bf26cf","line":134,"in_reply_to":"3fa7e38b_6517b253","updated":"2019-10-02 14:16:14.000000000","message":"OK the mock.patch context manager works here because compute does a synchronous RPC call to conductor\u0027s migrate_server method so I will change this one.","commit_id":"d40023235f5d6fac646f3e535b7afe1f03c832df"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"733c15fbbffbbdf30084b35ad84fd3fd9328f09e","unresolved":false,"context_lines":[{"line_number":131,"context_line":"        def wrap_prep_resize(*args, **kwargs):"},{"line_number":132,"context_line":"            # Poison the AZ query to blow up as if the cell conductor does not"},{"line_number":133,"context_line":"            # have access to the API DB."},{"line_number":134,"context_line":"            self.useFixture("},{"line_number":135,"context_line":"                fixtures.MockPatch("},{"line_number":136,"context_line":"                    \u0027nova.objects.AggregateList.get_by_host\u0027,"},{"line_number":137,"context_line":"                    side_effect\u003doslo_db_exc.CantStartEngineError))"}],"source_content_type":"text/x-python","patch_set":2,"id":"3fa7e38b_f374c500","line":134,"in_reply_to":"3fa7e38b_b0bf26cf","updated":"2019-10-02 17:28:13.000000000","message":"Actually it doesn\u0027t, see comments in PS3. If you remove the mock the test still passes because we always raise ComputeResourcesUnavailable but it\u0027s not for the reason we expect. So I\u0027m going to use MockFixture again.","commit_id":"d40023235f5d6fac646f3e535b7afe1f03c832df"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"fa3cdbfa241886878813a6d0a396bd8f215017d7","unresolved":false,"context_lines":[{"line_number":167,"context_line":"        # because of how ComputeManager._reschedule_resize_or_reraise works."},{"line_number":168,"context_line":"        # the reschedule call to conductor is an RPC call so that exception"},{"line_number":169,"context_line":"        # comes back to compute which injects a fault but then re-raises the"},{"line_number":170,"context_line":"        # ComputeResourcesUnavailable exception which gets recorded as the most"},{"line_number":171,"context_line":"        # recent fault which is what shows up in the API."},{"line_number":172,"context_line":"        self.assertIn(\u0027Insufficient compute resources\u0027,"},{"line_number":173,"context_line":"                      server[\u0027fault\u0027][\u0027message\u0027])"}],"source_content_type":"text/x-python","patch_set":3,"id":"3fa7e38b_10239ac0","line":171,"range":{"start_line":170,"start_character":48,"end_line":171,"end_character":56},"updated":"2019-10-02 14:37:47.000000000","message":"Can we somehow assert that your mock of the get_by_host() actually ran so we can be sure this isn\u0027t coming from something else?","commit_id":"d0d74c9e75202131ef315f2dca70c2e6573989de"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"24f0adc32c0d6611ba3fd444297242fa3ccf43a4","unresolved":false,"context_lines":[{"line_number":167,"context_line":"        # because of how ComputeManager._reschedule_resize_or_reraise works."},{"line_number":168,"context_line":"        # the reschedule call to conductor is an RPC call so that exception"},{"line_number":169,"context_line":"        # comes back to compute which injects a fault but then re-raises the"},{"line_number":170,"context_line":"        # ComputeResourcesUnavailable exception which gets recorded as the most"},{"line_number":171,"context_line":"        # recent fault which is what shows up in the API."},{"line_number":172,"context_line":"        self.assertIn(\u0027Insufficient compute resources\u0027,"},{"line_number":173,"context_line":"                      server[\u0027fault\u0027][\u0027message\u0027])"}],"source_content_type":"text/x-python","patch_set":3,"id":"3fa7e38b_2b3c2bbe","line":171,"range":{"start_line":170,"start_character":48,"end_line":171,"end_character":56},"in_reply_to":"3fa7e38b_10239ac0","updated":"2019-10-02 14:42:38.000000000","message":"I could keep a handle to the mock on self and assert it was called if that\u0027s what you\u0027re looking for.\n\nI was going to say if you remove the mock the test will fail, but that might not be true because the stub is unconditionally raising right now, unlike later in the series where I fix the bug and only raise on the first host tried. If I moved that \"only raise on first host\" logic to this patch, removing the mock should make the test fail if the AggregateList mock is removed. Which would you prefer?","commit_id":"d0d74c9e75202131ef315f2dca70c2e6573989de"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"24132c4907d0aa70973f85f88f497cb1f400c143","unresolved":false,"context_lines":[{"line_number":167,"context_line":"        # because of how ComputeManager._reschedule_resize_or_reraise works."},{"line_number":168,"context_line":"        # the reschedule call to conductor is an RPC call so that exception"},{"line_number":169,"context_line":"        # comes back to compute which injects a fault but then re-raises the"},{"line_number":170,"context_line":"        # ComputeResourcesUnavailable exception which gets recorded as the most"},{"line_number":171,"context_line":"        # recent fault which is what shows up in the API."},{"line_number":172,"context_line":"        self.assertIn(\u0027Insufficient compute resources\u0027,"},{"line_number":173,"context_line":"                      server[\u0027fault\u0027][\u0027message\u0027])"}],"source_content_type":"text/x-python","patch_set":3,"id":"3fa7e38b_4b6e47ca","line":171,"range":{"start_line":170,"start_character":48,"end_line":171,"end_character":56},"in_reply_to":"3fa7e38b_2b3c2bbe","updated":"2019-10-02 14:44:11.000000000","message":"Alternatively I could query the db for the instance faults and assert there is one in there for the CantStartEngineError.","commit_id":"d0d74c9e75202131ef315f2dca70c2e6573989de"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"5fb78e8b6bf276c3a09e07d72d2b9f417734bc14","unresolved":false,"context_lines":[{"line_number":167,"context_line":"        # because of how ComputeManager._reschedule_resize_or_reraise works."},{"line_number":168,"context_line":"        # the reschedule call to conductor is an RPC call so that exception"},{"line_number":169,"context_line":"        # comes back to compute which injects a fault but then re-raises the"},{"line_number":170,"context_line":"        # ComputeResourcesUnavailable exception which gets recorded as the most"},{"line_number":171,"context_line":"        # recent fault which is what shows up in the API."},{"line_number":172,"context_line":"        self.assertIn(\u0027Insufficient compute resources\u0027,"},{"line_number":173,"context_line":"                      server[\u0027fault\u0027][\u0027message\u0027])"}],"source_content_type":"text/x-python","patch_set":3,"id":"3fa7e38b_6ba8e3da","line":171,"range":{"start_line":170,"start_character":48,"end_line":171,"end_character":56},"in_reply_to":"3fa7e38b_2b3c2bbe","updated":"2019-10-02 14:45:20.000000000","message":"Personally I\u0027d rather see it asserted as called explicitly, but whatever you think is safest.","commit_id":"d0d74c9e75202131ef315f2dca70c2e6573989de"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"a6c1af4b427118d3878879a55b4236f6cc6de991","unresolved":false,"context_lines":[{"line_number":167,"context_line":"        # because of how ComputeManager._reschedule_resize_or_reraise works."},{"line_number":168,"context_line":"        # the reschedule call to conductor is an RPC call so that exception"},{"line_number":169,"context_line":"        # comes back to compute which injects a fault but then re-raises the"},{"line_number":170,"context_line":"        # ComputeResourcesUnavailable exception which gets recorded as the most"},{"line_number":171,"context_line":"        # recent fault which is what shows up in the API."},{"line_number":172,"context_line":"        self.assertIn(\u0027Insufficient compute resources\u0027,"},{"line_number":173,"context_line":"                      server[\u0027fault\u0027][\u0027message\u0027])"}],"source_content_type":"text/x-python","patch_set":3,"id":"3fa7e38b_d3cae918","line":171,"range":{"start_line":170,"start_character":48,"end_line":171,"end_character":56},"in_reply_to":"3fa7e38b_33f81d7b","updated":"2019-10-02 17:29:00.000000000","message":"Done","commit_id":"d0d74c9e75202131ef315f2dca70c2e6573989de"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"4eb696c88a2ad519e95e88ffdf0417d93721a0e4","unresolved":false,"context_lines":[{"line_number":167,"context_line":"        # because of how ComputeManager._reschedule_resize_or_reraise works."},{"line_number":168,"context_line":"        # the reschedule call to conductor is an RPC call so that exception"},{"line_number":169,"context_line":"        # comes back to compute which injects a fault but then re-raises the"},{"line_number":170,"context_line":"        # ComputeResourcesUnavailable exception which gets recorded as the most"},{"line_number":171,"context_line":"        # recent fault which is what shows up in the API."},{"line_number":172,"context_line":"        self.assertIn(\u0027Insufficient compute resources\u0027,"},{"line_number":173,"context_line":"                      server[\u0027fault\u0027][\u0027message\u0027])"}],"source_content_type":"text/x-python","patch_set":3,"id":"3fa7e38b_33f81d7b","line":171,"range":{"start_line":170,"start_character":48,"end_line":171,"end_character":56},"in_reply_to":"3fa7e38b_6ba8e3da","updated":"2019-10-02 17:23:50.000000000","message":"Hmm, something funky is going on here. I think it\u0027s the change from using the MockFixture to the mock.patch context manager because when I changed the stub to be like it is here:\n\nhttps://review.opendev.org/#/c/686050/3/nova/tests/functional/regressions/test_bug_1781286.py@130\n\nWe don\u0027t hit the expected failure because we reschedule from the first host for the cold migrate and then land on the second one. So I think I need to go back to using the MockFixture and keep a handle on it to assert it\u0027s called later.","commit_id":"d0d74c9e75202131ef315f2dca70c2e6573989de"}]}
