)]}'
{"nova/test.py":[{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"d9e2f62a8a89d3a513c7a1ef44deee0f311168f3","unresolved":false,"context_lines":[{"line_number":239,"context_line":"        return self._service.basic_config_check()"},{"line_number":240,"context_line":""},{"line_number":241,"context_line":"    def reset(self):"},{"line_number":242,"context_line":"        return self._service.reset()"},{"line_number":243,"context_line":""},{"line_number":244,"context_line":""},{"line_number":245,"context_line":"class TestCase(testtools.TestCase):"}],"source_content_type":"text/x-python","patch_set":2,"id":"7f515b1d_cdab0473","line":242,"updated":"2017-10-06 04:46:57.000000000","message":"Reminder to myself: Need some basic unit tests for these.","commit_id":"f61c987c94b541f32048bce0e8c52c56c214169e"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"868d89318516ac73ea898cf522c77262c17160e1","unresolved":false,"context_lines":[{"line_number":469,"context_line":""},{"line_number":470,"context_line":"            # NOTE(melwitt): Default untargeted database accesses to the"},{"line_number":471,"context_line":"            # cell database so that the service and compute node records"},{"line_number":472,"context_line":"            # are written to the cell database."},{"line_number":473,"context_line":"            real_get_admin_context \u003d context.get_admin_context"},{"line_number":474,"context_line":""},{"line_number":475,"context_line":"            def get_admin_context(read_deleted\u003d\"no\"):"}],"source_content_type":"text/x-python","patch_set":8,"id":"5f4e5783_665eb1e7","line":472,"updated":"2017-10-10 18:21:22.000000000","message":"This sentence now looks confusing to me. What I meant to say is that here we want to make anonymous admin contexts targeted to the cell database of the compute service during startup tasks, so that records get created in the cell database.","commit_id":"c67844f2190107cbcfc3e9288bba1f6ccfc5c0a4"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"b2ad7006a6463ba299ca38681ef2a4f683f5d106","unresolved":false,"context_lines":[{"line_number":231,"context_line":"    def stop(self):"},{"line_number":232,"context_line":"        return self._service.stop()"},{"line_number":233,"context_line":""},{"line_number":234,"context_line":"    def periodic_tasks(self, *args, **kwargs):"},{"line_number":235,"context_line":"        with fixtures.MonkeyPatch(\u0027nova.context.get_admin_context\u0027,"},{"line_number":236,"context_line":"                                  self._get_admin_context):"},{"line_number":237,"context_line":"            return self._service.periodic_tasks(*args, **kwargs)"}],"source_content_type":"text/x-python","patch_set":9,"id":"ff82abbf_32927158","line":234,"updated":"2017-11-29 21:08:47.000000000","message":"This will only take effect if we poke periodic tasks from the test themselves, not if they are run because their timer happens to come due. Since the timer in Service generates a context each time it runs, those will run with a cell0-targeted context I think.\n\nAlso definitely worth a comment here so people know that this wrapper is only for manually-triggered periodic runs.","commit_id":"2b803721e8cdaceb028b192f0dd41efa768858d6"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"414c67ffe938708eebe7c58358655b1956e4de6d","unresolved":false,"context_lines":[{"line_number":231,"context_line":"    def stop(self):"},{"line_number":232,"context_line":"        return self._service.stop()"},{"line_number":233,"context_line":""},{"line_number":234,"context_line":"    def periodic_tasks(self, *args, **kwargs):"},{"line_number":235,"context_line":"        with fixtures.MonkeyPatch(\u0027nova.context.get_admin_context\u0027,"},{"line_number":236,"context_line":"                                  self._get_admin_context):"},{"line_number":237,"context_line":"            return self._service.periodic_tasks(*args, **kwargs)"}],"source_content_type":"text/x-python","patch_set":9,"id":"ff82abbf_dd41d5a7","line":234,"in_reply_to":"ff82abbf_32927158","updated":"2017-11-29 21:24:38.000000000","message":"I thought this should work because I\u0027m temporarily monkey-patching nova.context.get_admin_context here to return the associated cell connection (see L214) before running the real Service.periodic_tasks method. Am I missing something there?","commit_id":"2b803721e8cdaceb028b192f0dd41efa768858d6"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"9526b1ca637d51e3f598d571e8dc5dc3ea770948","unresolved":false,"context_lines":[{"line_number":231,"context_line":"    def stop(self):"},{"line_number":232,"context_line":"        return self._service.stop()"},{"line_number":233,"context_line":""},{"line_number":234,"context_line":"    def periodic_tasks(self, *args, **kwargs):"},{"line_number":235,"context_line":"        with fixtures.MonkeyPatch(\u0027nova.context.get_admin_context\u0027,"},{"line_number":236,"context_line":"                                  self._get_admin_context):"},{"line_number":237,"context_line":"            return self._service.periodic_tasks(*args, **kwargs)"}],"source_content_type":"text/x-python","patch_set":9,"id":"ff82abbf_e94ac6aa","line":234,"in_reply_to":"ff82abbf_dd41d5a7","updated":"2017-11-30 15:22:00.000000000","message":"Unless I\u0027m missing something, this is just the thing that is returned to whoever called self.start_service(), which means it\u0027s not actually overriding the periodic_tasks() behavior of the Service object. That means if I do this:\n\n  compute \u003d self.start_service(\u0027compute\u0027)\n  compute.periodic_tasks()\n\nthen your wrapped version will run. If I do this:\n\n  compute \u003d self.start_service(\u0027compute\u0027)\n  time.sleep(120)\n\nthe periodic will run with only Service.periodic_tasks(), no wrapper, since that is what gets passed to the timer.","commit_id":"2b803721e8cdaceb028b192f0dd41efa768858d6"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"7a744b35f326a14f90e6060e97aad427c8685bc4","unresolved":false,"context_lines":[{"line_number":231,"context_line":"    def stop(self):"},{"line_number":232,"context_line":"        return self._service.stop()"},{"line_number":233,"context_line":""},{"line_number":234,"context_line":"    def periodic_tasks(self, *args, **kwargs):"},{"line_number":235,"context_line":"        with fixtures.MonkeyPatch(\u0027nova.context.get_admin_context\u0027,"},{"line_number":236,"context_line":"                                  self._get_admin_context):"},{"line_number":237,"context_line":"            return self._service.periodic_tasks(*args, **kwargs)"}],"source_content_type":"text/x-python","patch_set":9,"id":"ff82abbf_1d7c041f","line":234,"in_reply_to":"ff82abbf_e94ac6aa","updated":"2017-11-30 17:23:47.000000000","message":"Thanks for showing that example, I think I understand your point now. The periodic tasks are kicked off in Service\u0027s own start method which calls self.periodic_tasks periodically in a thread. I had been thinking erroneously that the oslo timer kept the context and reused it but I see now that it doesn\u0027t. So since Service calls self.periodic_tasks, it won\u0027t get the wrapped version. :(\n\nI see now what you were saying on IRC about passing a context once and having it be reused each time the timer fires. I wonder if it would be okay to just store it as member data on Service and just reuse it similarly as it is now?","commit_id":"2b803721e8cdaceb028b192f0dd41efa768858d6"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"9526b1ca637d51e3f598d571e8dc5dc3ea770948","unresolved":false,"context_lines":[{"line_number":484,"context_line":"                                      get_admin_context):"},{"line_number":485,"context_line":"                svc \u003d self.useFixture("},{"line_number":486,"context_line":"                    nova_fixtures.ServiceFixture(name, host, **kwargs))"},{"line_number":487,"context_line":"                return ServiceWrapper(svc.service, cell)"},{"line_number":488,"context_line":"        else:"},{"line_number":489,"context_line":"            svc \u003d self.useFixture("},{"line_number":490,"context_line":"                nova_fixtures.ServiceFixture(name, host, **kwargs))"}],"source_content_type":"text/x-python","patch_set":9,"id":"ff82abbf_e9f8864a","line":487,"updated":"2017-11-30 15:22:00.000000000","message":"Only used here, which means the wrapper is only returned to the caller of start_service(). If the caller didn\u0027t store the result then your wrapper instance goes away immediately because it\u0027s no longer needed. Thus it can\u0027t have an effect on the timer-based periodics that may run during a long test and/or due to periodic staggered timing luck.","commit_id":"2b803721e8cdaceb028b192f0dd41efa768858d6"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"97527a8381a6dfc2f5ea3771de1738a1e8e87b61","unresolved":false,"context_lines":[{"line_number":484,"context_line":"                return ctxt"},{"line_number":485,"context_line":""},{"line_number":486,"context_line":"            with fixtures.MonkeyPatch(\u0027nova.context.get_admin_context\u0027,"},{"line_number":487,"context_line":"                                      get_admin_context):"},{"line_number":488,"context_line":"                svc \u003d self.useFixture("},{"line_number":489,"context_line":"                    nova_fixtures.ServiceFixture(name, host, **kwargs))"},{"line_number":490,"context_line":"                return ServiceWrapper(svc.service, cell)"}],"source_content_type":"text/x-python","patch_set":11,"id":"ff82abbf_848674db","line":487,"updated":"2017-11-30 21:44:37.000000000","message":"In case anyone is wondering why this has to be done both here and in ServiceWrapper.start, it\u0027s because useFixture will call ServiceFixture.setUp which calls Service.create and Service.start and we need Service.start to target the correct cell database because it creates records.\n\nWhen writing tests, developers can and do call start() separately when stopping/starting services, so cell targeting for that has to be handled in the wrapper separately.\n\nAnd ServiceWrapper.create doesn\u0027t target a cell because no database writes occur in Service.create.","commit_id":"694efdb4accc0e7916d1fbd0f25d75c385515b5b"}],"nova/tests/functional/compute/test_instance_list.py":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"06678c5d7f4e543666f7f9059b12a14850e31941","unresolved":false,"context_lines":[{"line_number":498,"context_line":"        self.assertEqual(0, len([inst for inst in insts"},{"line_number":499,"context_line":"                                 if \u0027fault\u0027 in inst]))"},{"line_number":500,"context_line":""},{"line_number":501,"context_line":"    @testtools.skip(\u0027This test relies on lazy-loading and \u0027"},{"line_number":502,"context_line":"                    \u0027get_instance_objects_sorted does not target each \u0027"},{"line_number":503,"context_line":"                    \u0027Instance._context to the cell of the instance.\u0027)"},{"line_number":504,"context_line":"    def test_get_instance_objects_sorted_with_fault(self):"},{"line_number":505,"context_line":"        filters \u003d {}"},{"line_number":506,"context_line":"        limit \u003d None"}],"source_content_type":"text/x-python","patch_set":9,"id":"ff82abbf_f13e32b8","line":503,"range":{"start_line":501,"start_character":0,"end_line":503,"end_character":69},"updated":"2017-11-30 13:32:45.000000000","message":"Is it problem in the test setup or is it a bug in the get_instance_objects_sorted code?\n\nAs far as I understand it is the later. If I\u0027m right then we should open a bug report and add the bug number to the skip.","commit_id":"2b803721e8cdaceb028b192f0dd41efa768858d6"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"b0b35dcf4ce084def03e6c064e85ca8d008d77c1","unresolved":false,"context_lines":[{"line_number":498,"context_line":"        self.assertEqual(0, len([inst for inst in insts"},{"line_number":499,"context_line":"                                 if \u0027fault\u0027 in inst]))"},{"line_number":500,"context_line":""},{"line_number":501,"context_line":"    @testtools.skip(\u0027This test relies on lazy-loading and \u0027"},{"line_number":502,"context_line":"                    \u0027get_instance_objects_sorted does not target each \u0027"},{"line_number":503,"context_line":"                    \u0027Instance._context to the cell of the instance.\u0027)"},{"line_number":504,"context_line":"    def test_get_instance_objects_sorted_with_fault(self):"},{"line_number":505,"context_line":"        filters \u003d {}"},{"line_number":506,"context_line":"        limit \u003d None"}],"source_content_type":"text/x-python","patch_set":9,"id":"ff82abbf_2420c849","line":503,"range":{"start_line":501,"start_character":0,"end_line":503,"end_character":69},"in_reply_to":"ff82abbf_f13e32b8","updated":"2017-11-30 21:31:56.000000000","message":"It\u0027s a bug/limitation in get_instance_objects_sorted BUT get_instance_objects_sorted isn\u0027t connected to the API anywhere yet, and so it\u0027s not a user-facing bug/limitation at present. So dansmith had suggested either removing this test altogether or skipping it with a note and I did the latter.","commit_id":"2b803721e8cdaceb028b192f0dd41efa768858d6"}],"nova/tests/functional/db/test_request_spec.py":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"06678c5d7f4e543666f7f9059b12a14850e31941","unresolved":false,"context_lines":[{"line_number":111,"context_line":"        # so the default self.compute service is being used. See nova/test.py"},{"line_number":112,"context_line":"        # for details."},{"line_number":113,"context_line":"        # Target the compute cell to find instances and block device mappings."},{"line_number":114,"context_line":"        context.set_target_cell(self.context, self.compute.cell)"},{"line_number":115,"context_line":"        self.instances \u003d objects.InstanceList.get_all(self.context)"},{"line_number":116,"context_line":"        # Make sure that we have all the needed instances"},{"line_number":117,"context_line":"        self.assertEqual(total, len(self.instances))"}],"source_content_type":"text/x-python","patch_set":9,"id":"ff82abbf_71d0e254","line":114,"updated":"2017-11-30 13:32:45.000000000","message":"Can we do this right after the context.get_admin_context() call in the setUp? That would seem more logical to me.","commit_id":"2b803721e8cdaceb028b192f0dd41efa768858d6"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"b0b35dcf4ce084def03e6c064e85ca8d008d77c1","unresolved":false,"context_lines":[{"line_number":111,"context_line":"        # so the default self.compute service is being used. See nova/test.py"},{"line_number":112,"context_line":"        # for details."},{"line_number":113,"context_line":"        # Target the compute cell to find instances and block device mappings."},{"line_number":114,"context_line":"        context.set_target_cell(self.context, self.compute.cell)"},{"line_number":115,"context_line":"        self.instances \u003d objects.InstanceList.get_all(self.context)"},{"line_number":116,"context_line":"        # Make sure that we have all the needed instances"},{"line_number":117,"context_line":"        self.assertEqual(total, len(self.instances))"}],"source_content_type":"text/x-python","patch_set":9,"id":"ff82abbf_e4c74064","line":114,"in_reply_to":"ff82abbf_71d0e254","updated":"2017-11-30 21:31:56.000000000","message":"Hm, we could. I think I put it here to place it closer to the code where it matters (finding instances) but I\u0027m not really opinionated about where it goes.","commit_id":"2b803721e8cdaceb028b192f0dd41efa768858d6"}],"nova/tests/functional/notification_sample_tests/notification_sample_base.py":[{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"d9e2f62a8a89d3a513c7a1ef44deee0f311168f3","unresolved":false,"context_lines":[{"line_number":225,"context_line":"                         \u0027within the given timeout. \u0027"},{"line_number":226,"context_line":"                         \u0027Expected %d, got %d: %s\u0027 %"},{"line_number":227,"context_line":"                         (event_type, expected_count, len(notifications),"},{"line_number":228,"context_line":"                          msg))"},{"line_number":229,"context_line":"        return notifications"},{"line_number":230,"context_line":""},{"line_number":231,"context_line":"    def _attach_volume_to_server(self, server, volume_id):"}],"source_content_type":"text/x-python","patch_set":2,"id":"7f515b1d_2db4d8d0","line":228,"updated":"2017-10-06 04:46:57.000000000","message":"Reminder to self: This was supposed to be a separate change.","commit_id":"f61c987c94b541f32048bce0e8c52c56c214169e"}],"nova/tests/functional/notification_sample_tests/test_instance.py":[{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"5ecbfc4161174b35b0136ababfcc334a29cc8378","unresolved":false,"context_lines":[{"line_number":337,"context_line":"        # Let\u0027s generate some bandwidth usage data."},{"line_number":338,"context_line":"        # Just call the periodic task directly for simplicity"},{"line_number":339,"context_line":"        # NOTE(melwitt): Since start_service was called without specifying a"},{"line_number":340,"context_line":"        # cell kwarg, the default self.compute service will be used by."},{"line_number":341,"context_line":"        # See nova/test.py for details."},{"line_number":342,"context_line":"        ctxt \u003d context.get_admin_context()"},{"line_number":343,"context_line":"        with context.target_cell(ctxt, self.compute.cell) as cctxt:"}],"source_content_type":"text/x-python","patch_set":7,"id":"5f4e5783_821882d3","line":340,"range":{"start_line":340,"start_character":67,"end_line":340,"end_character":70},"updated":"2017-10-10 14:28:06.000000000","message":"This was supposed to be deleted.","commit_id":"4450badaffaf958ce5661b845c3a27cdc4bb111a"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"868d89318516ac73ea898cf522c77262c17160e1","unresolved":false,"context_lines":[{"line_number":337,"context_line":"        # Let\u0027s generate some bandwidth usage data."},{"line_number":338,"context_line":"        # Just call the periodic task directly for simplicity"},{"line_number":339,"context_line":"        # NOTE(melwitt): Since start_service was called without specifying a"},{"line_number":340,"context_line":"        # cell kwarg, the default self.compute service will be used by."},{"line_number":341,"context_line":"        # See nova/test.py for details."},{"line_number":342,"context_line":"        ctxt \u003d context.get_admin_context()"},{"line_number":343,"context_line":"        with context.target_cell(ctxt, self.compute.cell) as cctxt:"}],"source_content_type":"text/x-python","patch_set":8,"id":"5f4e5783_066dbd97","line":340,"range":{"start_line":340,"start_character":67,"end_line":340,"end_character":70},"updated":"2017-10-10 18:21:22.000000000","message":"Still need to remove this.","commit_id":"c67844f2190107cbcfc3e9288bba1f6ccfc5c0a4"}]}
