)]}'
{"nova/conductor/manager.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"a1045d2b5abc63eee211f0fa995435573ea773ae","unresolved":false,"context_lines":[{"line_number":747,"context_line":""},{"line_number":748,"context_line":"            # The availability_zone field was added in v1.1 of the Selection"},{"line_number":749,"context_line":"            # object so make sure to handle the case where it is missing."},{"line_number":750,"context_line":"            if \u0027availability_zone\u0027 in host:"},{"line_number":751,"context_line":"                instance.availability_zone \u003d host.availability_zone"},{"line_number":752,"context_line":"            else:"},{"line_number":753,"context_line":"                try:"},{"line_number":754,"context_line":"                    instance.availability_zone \u003d ("},{"line_number":755,"context_line":"                        availability_zones.get_host_availability_zone(context,"},{"line_number":756,"context_line":"                                host.service_host))"},{"line_number":757,"context_line":"                except Exception as exc:"},{"line_number":758,"context_line":"                    # Put the instance into ERROR state, set task_state to"},{"line_number":759,"context_line":"                    # None, inject a fault, etc."}],"source_content_type":"text/x-python","patch_set":4,"id":"3fa7e38b_02f9094c","line":756,"range":{"start_line":750,"start_character":0,"end_line":756,"end_character":51},"updated":"2019-10-02 21:16:31.000000000","message":"Do we not want to validate this in any unit tests? It makes me a teensy bit nervous to just have this tested in a functional test for a specific bug.","commit_id":"f1ad0b13e8f8296739f75b11e257a6fef2cc538c"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"cf54197efcd98171189da7d59e5f28acfefd72a0","unresolved":false,"context_lines":[{"line_number":747,"context_line":""},{"line_number":748,"context_line":"            # The availability_zone field was added in v1.1 of the Selection"},{"line_number":749,"context_line":"            # object so make sure to handle the case where it is missing."},{"line_number":750,"context_line":"            if \u0027availability_zone\u0027 in host:"},{"line_number":751,"context_line":"                instance.availability_zone \u003d host.availability_zone"},{"line_number":752,"context_line":"            else:"},{"line_number":753,"context_line":"                try:"},{"line_number":754,"context_line":"                    instance.availability_zone \u003d ("},{"line_number":755,"context_line":"                        availability_zones.get_host_availability_zone(context,"},{"line_number":756,"context_line":"                                host.service_host))"},{"line_number":757,"context_line":"                except Exception as exc:"},{"line_number":758,"context_line":"                    # Put the instance into ERROR state, set task_state to"},{"line_number":759,"context_line":"                    # None, inject a fault, etc."}],"source_content_type":"text/x-python","patch_set":4,"id":"3fa7e38b_c8ed538c","line":756,"range":{"start_line":750,"start_character":0,"end_line":756,"end_character":51},"in_reply_to":"3fa7e38b_02f9094c","updated":"2019-10-02 22:18:31.000000000","message":"See the comment in the commit message. The functional test hits the if block, existing unit tests hit the else block.","commit_id":"f1ad0b13e8f8296739f75b11e257a6fef2cc538c"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"b4510c9b11698056ae37f84bfd8c4fcaca62ff36","unresolved":false,"context_lines":[{"line_number":747,"context_line":""},{"line_number":748,"context_line":"            # The availability_zone field was added in v1.1 of the Selection"},{"line_number":749,"context_line":"            # object so make sure to handle the case where it is missing."},{"line_number":750,"context_line":"            if \u0027availability_zone\u0027 in host:"},{"line_number":751,"context_line":"                instance.availability_zone \u003d host.availability_zone"},{"line_number":752,"context_line":"            else:"},{"line_number":753,"context_line":"                try:"},{"line_number":754,"context_line":"                    instance.availability_zone \u003d ("},{"line_number":755,"context_line":"                        availability_zones.get_host_availability_zone(context,"},{"line_number":756,"context_line":"                                host.service_host))"},{"line_number":757,"context_line":"                except Exception as exc:"},{"line_number":758,"context_line":"                    # Put the instance into ERROR state, set task_state to"},{"line_number":759,"context_line":"                    # None, inject a fault, etc."}],"source_content_type":"text/x-python","patch_set":4,"id":"3fa7e38b_5ea10e95","line":756,"range":{"start_line":750,"start_character":0,"end_line":756,"end_character":51},"in_reply_to":"3fa7e38b_c8ed538c","updated":"2019-10-03 16:23:22.000000000","message":"...Yeah, I know.","commit_id":"f1ad0b13e8f8296739f75b11e257a6fef2cc538c"}],"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":"7f63e9c83889095612ffd449d36d799cd95a75dc","unresolved":false,"context_lines":[{"line_number":84,"context_line":"        # compute service we have to wait for the notification that the build"},{"line_number":85,"context_line":"        # is complete and then stop the mock so we can use the API again."},{"line_number":86,"context_line":"        fake_notifier.wait_for_versioned_notifications(\u0027instance.create.end\u0027)"},{"line_number":87,"context_line":"        # Note that we use stopall here because we actually called"},{"line_number":88,"context_line":"        # build_and_run_instance twice so we have more than one instance of"},{"line_number":89,"context_line":"        # the mock that needs to be stopped."},{"line_number":90,"context_line":"        mock.patch.stopall()"},{"line_number":91,"context_line":"        server \u003d self._wait_for_state_change(self.api, server, \u0027ACTIVE\u0027)"},{"line_number":92,"context_line":"        # We should have rescheduled and the instance AZ should be set from the"},{"line_number":93,"context_line":"        # Selection object. Since neither compute host is in an AZ, the server"}],"source_content_type":"text/x-python","patch_set":2,"id":"3fa7e38b_ffba5108","line":90,"range":{"start_line":87,"start_character":0,"end_line":90,"end_character":28},"updated":"2019-10-02 11:06:22.000000000","message":"That feels shaky. Why don\u0027t we limit the scope of the mocking with a context manager \nin wrap_bari():\n\n  with mock.patch(\u0027nova.objects.AggregateList.get_by_host\u0027, side_effect\u003doslo_db_exc.CantStartEngineError):\n      return original_bari(*args, **kwargs)","commit_id":"cf9c7102dd6e087bacefc5ae8095007ceba19c53"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e394ba4e2ec67cbfaaf5f124406881933744ca05","unresolved":false,"context_lines":[{"line_number":84,"context_line":"        # compute service we have to wait for the notification that the build"},{"line_number":85,"context_line":"        # is complete and then stop the mock so we can use the API again."},{"line_number":86,"context_line":"        fake_notifier.wait_for_versioned_notifications(\u0027instance.create.end\u0027)"},{"line_number":87,"context_line":"        # Note that we use stopall here because we actually called"},{"line_number":88,"context_line":"        # build_and_run_instance twice so we have more than one instance of"},{"line_number":89,"context_line":"        # the mock that needs to be stopped."},{"line_number":90,"context_line":"        mock.patch.stopall()"},{"line_number":91,"context_line":"        server \u003d self._wait_for_state_change(self.api, server, \u0027ACTIVE\u0027)"},{"line_number":92,"context_line":"        # We should have rescheduled and the instance AZ should be set from the"},{"line_number":93,"context_line":"        # Selection object. Since neither compute host is in an AZ, the server"}],"source_content_type":"text/x-python","patch_set":2,"id":"3fa7e38b_90fd4a0a","line":90,"range":{"start_line":87,"start_character":0,"end_line":90,"end_character":28},"in_reply_to":"3fa7e38b_ffba5108","updated":"2019-10-02 13:56:39.000000000","message":"As I said earlier:\n\nhttps://review.opendev.org/#/c/685998/3/nova/tests/functional/regressions/test_bug_1781286.py@72\n\nI don\u0027t think that will work, or it will at least be racy, because we need the mock to persist past the compute RPC cast to conductor during the reschedule but can\u0027t apply it before we initiate the server create in the API. That\u0027s why it\u0027s tricky.","commit_id":"cf9c7102dd6e087bacefc5ae8095007ceba19c53"}]}
