)]}'
{"nova/tests/functional/test_servers.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"14fa040b6bf45699aff6d4cf7c65b3dd16fd4adf","unresolved":false,"context_lines":[{"line_number":6638,"context_line":""},{"line_number":6639,"context_line":"    def test_migrate_server_with_qos_port_reschedule_success(self):"},{"line_number":6640,"context_line":"        self._start_compute(\u0027host3\u0027)"},{"line_number":6641,"context_line":"        compute3_rp_uuid \u003d self._get_provider_uuid_by_host(\u0027host3\u0027)"},{"line_number":6642,"context_line":"        self._create_networking_rp_tree(compute3_rp_uuid)"},{"line_number":6643,"context_line":""},{"line_number":6644,"context_line":"        non_qos_port \u003d self.neutron.port_1"}],"source_content_type":"text/x-python","patch_set":17,"id":"5faad753_2f8637dd","line":6641,"updated":"2019-09-10 18:09:01.000000000","message":"OK so we\u0027ll start on host1, trigger a fail and reschedule from host2 and then land and complete on host3.","commit_id":"7fa66dbd6a539dfae7bd8c8db47c7db8b20357e4"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"14fa040b6bf45699aff6d4cf7c65b3dd16fd4adf","unresolved":false,"context_lines":[{"line_number":6652,"context_line":""},{"line_number":6653,"context_line":"        prep_resize_calls \u003d []"},{"line_number":6654,"context_line":""},{"line_number":6655,"context_line":"        def fake_prep_resize(_self, *args, **kwargs):"},{"line_number":6656,"context_line":"            # Make the first prep_resize fail and the rest passing through"},{"line_number":6657,"context_line":"            # the original _prep_resize call"},{"line_number":6658,"context_line":"            if not prep_resize_calls:"}],"source_content_type":"text/x-python","patch_set":17,"id":"5faad753_af4307af","line":6655,"range":{"start_line":6655,"start_character":12,"end_line":6655,"end_character":28},"updated":"2019-09-10 18:09:01.000000000","message":"(Unrelated to Sylvain\u0027s comment) I was thinking we had a fake virt driver that triggered reschedules for resize but I only see one for triggering reschedules for build/spawn and besides that would mean defining a new test class to use that fake virt driver and extract a bunch of the helper code in this test class into a mixin to use in both, so not worth the effort right now. We have plenty of resize tests that hit reschedule that do this same pattern.","commit_id":"7fa66dbd6a539dfae7bd8c8db47c7db8b20357e4"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"2fbd34efc9b513183f4e95044068a63d84961ca3","unresolved":false,"context_lines":[{"line_number":6652,"context_line":""},{"line_number":6653,"context_line":"        prep_resize_calls \u003d []"},{"line_number":6654,"context_line":""},{"line_number":6655,"context_line":"        def fake_prep_resize(_self, *args, **kwargs):"},{"line_number":6656,"context_line":"            # Make the first prep_resize fail and the rest passing through"},{"line_number":6657,"context_line":"            # the original _prep_resize call"},{"line_number":6658,"context_line":"            if not prep_resize_calls:"}],"source_content_type":"text/x-python","patch_set":17,"id":"5faad753_807e2369","line":6655,"updated":"2019-09-10 14:15:47.000000000","message":"you could have factorized the inner method, but okay.","commit_id":"7fa66dbd6a539dfae7bd8c8db47c7db8b20357e4"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"902e9bf3fc045ed66fda66f4d3426b215a5a7e99","unresolved":false,"context_lines":[{"line_number":6652,"context_line":""},{"line_number":6653,"context_line":"        prep_resize_calls \u003d []"},{"line_number":6654,"context_line":""},{"line_number":6655,"context_line":"        def fake_prep_resize(_self, *args, **kwargs):"},{"line_number":6656,"context_line":"            # Make the first prep_resize fail and the rest passing through"},{"line_number":6657,"context_line":"            # the original _prep_resize call"},{"line_number":6658,"context_line":"            if not prep_resize_calls:"}],"source_content_type":"text/x-python","patch_set":17,"id":"5faad753_f4846a0e","line":6655,"in_reply_to":"5faad753_807e2369","updated":"2019-09-11 08:36:07.000000000","message":"The second fake_prep_resize went away.","commit_id":"7fa66dbd6a539dfae7bd8c8db47c7db8b20357e4"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"14fa040b6bf45699aff6d4cf7c65b3dd16fd4adf","unresolved":false,"context_lines":[{"line_number":6659,"context_line":"                prep_resize_calls.append(_self.host)"},{"line_number":6660,"context_line":"                raise test.TestingException(\u0027Simulated prep_resize failure.\u0027)"},{"line_number":6661,"context_line":"            prep_resize_calls.append(_self.host)"},{"line_number":6662,"context_line":"            original_prep_resize(_self, *args, **kwargs)"},{"line_number":6663,"context_line":""},{"line_number":6664,"context_line":"        # Yes this isn\u0027t great in a functional test, but it\u0027s simple."},{"line_number":6665,"context_line":"        original_prep_resize \u003d compute_manager.ComputeManager._prep_resize"}],"source_content_type":"text/x-python","patch_set":17,"id":"5faad753_4f7933fa","line":6662,"range":{"start_line":6662,"start_character":12,"end_line":6662,"end_character":32},"updated":"2019-09-10 18:09:01.000000000","message":"It\u0027s always weird to me that python lets you use something in an inner function before it\u0027s defined.","commit_id":"7fa66dbd6a539dfae7bd8c8db47c7db8b20357e4"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"902e9bf3fc045ed66fda66f4d3426b215a5a7e99","unresolved":false,"context_lines":[{"line_number":6659,"context_line":"                prep_resize_calls.append(_self.host)"},{"line_number":6660,"context_line":"                raise test.TestingException(\u0027Simulated prep_resize failure.\u0027)"},{"line_number":6661,"context_line":"            prep_resize_calls.append(_self.host)"},{"line_number":6662,"context_line":"            original_prep_resize(_self, *args, **kwargs)"},{"line_number":6663,"context_line":""},{"line_number":6664,"context_line":"        # Yes this isn\u0027t great in a functional test, but it\u0027s simple."},{"line_number":6665,"context_line":"        original_prep_resize \u003d compute_manager.ComputeManager._prep_resize"}],"source_content_type":"text/x-python","patch_set":17,"id":"5faad753_f10ebc8b","line":6662,"range":{"start_line":6662,"start_character":12,"end_line":6662,"end_character":32},"in_reply_to":"5faad753_4f7933fa","updated":"2019-09-11 08:36:07.000000000","message":"I tend to avoid this. So this is a mistake from me. Moved L6665 before the def.","commit_id":"7fa66dbd6a539dfae7bd8c8db47c7db8b20357e4"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"14fa040b6bf45699aff6d4cf7c65b3dd16fd4adf","unresolved":false,"context_lines":[{"line_number":6669,"context_line":"        # is reschedule on the other host where it will succeed"},{"line_number":6670,"context_line":"        with mock.patch.object("},{"line_number":6671,"context_line":"                compute_manager.ComputeManager, \u0027_prep_resize\u0027,"},{"line_number":6672,"context_line":"                new\u003dfake_prep_resize):"},{"line_number":6673,"context_line":"            self.api.post_server_action(server[\u0027id\u0027], {\u0027migrate\u0027: None})"},{"line_number":6674,"context_line":"            self._wait_for_state_change(self.api, server, \u0027VERIFY_RESIZE\u0027)"},{"line_number":6675,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"5faad753_ef67bf50","line":6672,"range":{"start_line":6672,"start_character":16,"end_line":6672,"end_character":19},"updated":"2019-09-10 18:09:01.000000000","message":"I\u0027d normally expect to see side_effect here.","commit_id":"7fa66dbd6a539dfae7bd8c8db47c7db8b20357e4"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"902e9bf3fc045ed66fda66f4d3426b215a5a7e99","unresolved":false,"context_lines":[{"line_number":6669,"context_line":"        # is reschedule on the other host where it will succeed"},{"line_number":6670,"context_line":"        with mock.patch.object("},{"line_number":6671,"context_line":"                compute_manager.ComputeManager, \u0027_prep_resize\u0027,"},{"line_number":6672,"context_line":"                new\u003dfake_prep_resize):"},{"line_number":6673,"context_line":"            self.api.post_server_action(server[\u0027id\u0027], {\u0027migrate\u0027: None})"},{"line_number":6674,"context_line":"            self._wait_for_state_change(self.api, server, \u0027VERIFY_RESIZE\u0027)"},{"line_number":6675,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"5faad753_d1ff0032","line":6672,"range":{"start_line":6672,"start_character":16,"end_line":6672,"end_character":19},"in_reply_to":"5faad753_ef67bf50","updated":"2019-09-11 08:36:07.000000000","message":"I tried with side_effect but parameter handling blows in the fake def. I guess it is something about autospecing","commit_id":"7fa66dbd6a539dfae7bd8c8db47c7db8b20357e4"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"14fa040b6bf45699aff6d4cf7c65b3dd16fd4adf","unresolved":false,"context_lines":[{"line_number":6674,"context_line":"            self._wait_for_state_change(self.api, server, \u0027VERIFY_RESIZE\u0027)"},{"line_number":6675,"context_line":""},{"line_number":6676,"context_line":"        # ensure that resize is tried on two hosts, so we had a re-schedule"},{"line_number":6677,"context_line":"        self.assertItemsEqual([\u0027host2\u0027, \u0027host3\u0027], prep_resize_calls)"},{"line_number":6678,"context_line":""},{"line_number":6679,"context_line":"        host_rp_uuid \u003d (self.compute2_rp_uuid"},{"line_number":6680,"context_line":"                        if prep_resize_calls[-1] \u003d\u003d \u0027host2\u0027"}],"source_content_type":"text/x-python","patch_set":17,"id":"5faad753_0f5c9b7c","line":6677,"range":{"start_line":6677,"start_character":13,"end_line":6677,"end_character":29},"updated":"2019-09-10 18:09:01.000000000","message":"And using this only checks the items are the same, not the order. Got it. The HostNameWeigher used in this class will also ensure host2 comes before host3 but it\u0027s a nit.","commit_id":"7fa66dbd6a539dfae7bd8c8db47c7db8b20357e4"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"902e9bf3fc045ed66fda66f4d3426b215a5a7e99","unresolved":false,"context_lines":[{"line_number":6674,"context_line":"            self._wait_for_state_change(self.api, server, \u0027VERIFY_RESIZE\u0027)"},{"line_number":6675,"context_line":""},{"line_number":6676,"context_line":"        # ensure that resize is tried on two hosts, so we had a re-schedule"},{"line_number":6677,"context_line":"        self.assertItemsEqual([\u0027host2\u0027, \u0027host3\u0027], prep_resize_calls)"},{"line_number":6678,"context_line":""},{"line_number":6679,"context_line":"        host_rp_uuid \u003d (self.compute2_rp_uuid"},{"line_number":6680,"context_line":"                        if prep_resize_calls[-1] \u003d\u003d \u0027host2\u0027"}],"source_content_type":"text/x-python","patch_set":17,"id":"5faad753_918e68ce","line":6677,"range":{"start_line":6677,"start_character":13,"end_line":6677,"end_character":29},"in_reply_to":"5faad753_0f5c9b7c","updated":"2019-09-11 08:36:07.000000000","message":"First there was no weigher involved then I realized I need it for determinism. And then I forget to remove the Items assert. Done.","commit_id":"7fa66dbd6a539dfae7bd8c8db47c7db8b20357e4"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"14fa040b6bf45699aff6d4cf7c65b3dd16fd4adf","unresolved":false,"context_lines":[{"line_number":6676,"context_line":"        # ensure that resize is tried on two hosts, so we had a re-schedule"},{"line_number":6677,"context_line":"        self.assertItemsEqual([\u0027host2\u0027, \u0027host3\u0027], prep_resize_calls)"},{"line_number":6678,"context_line":""},{"line_number":6679,"context_line":"        host_rp_uuid \u003d (self.compute2_rp_uuid"},{"line_number":6680,"context_line":"                        if prep_resize_calls[-1] \u003d\u003d \u0027host2\u0027"},{"line_number":6681,"context_line":"                        else compute3_rp_uuid)"},{"line_number":6682,"context_line":""},{"line_number":6683,"context_line":"        migration_uuid \u003d self.get_migration_uuid_for_instance(server[\u0027id\u0027])"},{"line_number":6684,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"5faad753_cf552352","line":6681,"range":{"start_line":6679,"start_character":8,"end_line":6681,"end_character":46},"updated":"2019-09-10 18:09:01.000000000","message":"As noted above, because of HostNameWeigher, we could assert that we expect to finally land on host3.\n\nYou could have also just gotten the host from the server\u0027s OS-EXT-SRV-ATTR:host attribute.","commit_id":"7fa66dbd6a539dfae7bd8c8db47c7db8b20357e4"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"902e9bf3fc045ed66fda66f4d3426b215a5a7e99","unresolved":false,"context_lines":[{"line_number":6676,"context_line":"        # ensure that resize is tried on two hosts, so we had a re-schedule"},{"line_number":6677,"context_line":"        self.assertItemsEqual([\u0027host2\u0027, \u0027host3\u0027], prep_resize_calls)"},{"line_number":6678,"context_line":""},{"line_number":6679,"context_line":"        host_rp_uuid \u003d (self.compute2_rp_uuid"},{"line_number":6680,"context_line":"                        if prep_resize_calls[-1] \u003d\u003d \u0027host2\u0027"},{"line_number":6681,"context_line":"                        else compute3_rp_uuid)"},{"line_number":6682,"context_line":""},{"line_number":6683,"context_line":"        migration_uuid \u003d self.get_migration_uuid_for_instance(server[\u0027id\u0027])"},{"line_number":6684,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"5faad753_f4f30a09","line":6681,"range":{"start_line":6679,"start_character":8,"end_line":6681,"end_character":46},"in_reply_to":"5faad753_cf552352","updated":"2019-09-11 08:36:07.000000000","message":"Done","commit_id":"7fa66dbd6a539dfae7bd8c8db47c7db8b20357e4"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"14fa040b6bf45699aff6d4cf7c65b3dd16fd4adf","unresolved":false,"context_lines":[{"line_number":6682,"context_line":""},{"line_number":6683,"context_line":"        migration_uuid \u003d self.get_migration_uuid_for_instance(server[\u0027id\u0027])"},{"line_number":6684,"context_line":""},{"line_number":6685,"context_line":"        # check that server is allocates from the final host properly while"},{"line_number":6686,"context_line":"        # the migration holds the allocation on the source host"},{"line_number":6687,"context_line":"        self._check_allocation("},{"line_number":6688,"context_line":"            server, host_rp_uuid, non_qos_port, qos_port,"}],"source_content_type":"text/x-python","patch_set":17,"id":"5faad753_8f4f2bbc","line":6685,"range":{"start_line":6685,"start_character":28,"end_line":6685,"end_character":30},"updated":"2019-09-10 18:09:01.000000000","message":"nix","commit_id":"7fa66dbd6a539dfae7bd8c8db47c7db8b20357e4"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"902e9bf3fc045ed66fda66f4d3426b215a5a7e99","unresolved":false,"context_lines":[{"line_number":6682,"context_line":""},{"line_number":6683,"context_line":"        migration_uuid \u003d self.get_migration_uuid_for_instance(server[\u0027id\u0027])"},{"line_number":6684,"context_line":""},{"line_number":6685,"context_line":"        # check that server is allocates from the final host properly while"},{"line_number":6686,"context_line":"        # the migration holds the allocation on the source host"},{"line_number":6687,"context_line":"        self._check_allocation("},{"line_number":6688,"context_line":"            server, host_rp_uuid, non_qos_port, qos_port,"}],"source_content_type":"text/x-python","patch_set":17,"id":"5faad753_d4d84e80","line":6685,"range":{"start_line":6685,"start_character":28,"end_line":6685,"end_character":30},"in_reply_to":"5faad753_8f4f2bbc","updated":"2019-09-11 08:36:07.000000000","message":"Done","commit_id":"7fa66dbd6a539dfae7bd8c8db47c7db8b20357e4"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"14fa040b6bf45699aff6d4cf7c65b3dd16fd4adf","unresolved":false,"context_lines":[{"line_number":6688,"context_line":"            server, host_rp_uuid, non_qos_port, qos_port,"},{"line_number":6689,"context_line":"            migration_uuid, source_compute_rp_uuid\u003dself.compute1_rp_uuid)"},{"line_number":6690,"context_line":""},{"line_number":6691,"context_line":"        self.api.post_server_action(server[\u0027id\u0027], {\u0027confirmResize\u0027: None})"},{"line_number":6692,"context_line":"        self._wait_for_migration_status(server, [\u0027confirmed\u0027])"},{"line_number":6693,"context_line":""},{"line_number":6694,"context_line":"        # check that allocation is still OK"},{"line_number":6695,"context_line":"        self._check_allocation(server, host_rp_uuid, non_qos_port, qos_port)"}],"source_content_type":"text/x-python","patch_set":17,"id":"5faad753_cfda03e8","line":6692,"range":{"start_line":6691,"start_character":8,"end_line":6692,"end_character":62},"updated":"2019-09-10 18:09:01.000000000","message":"Hmm, shouldn\u0027t we be using the _confirm_resize helper here? Because this will re-introduce the race right? -1 for this.","commit_id":"7fa66dbd6a539dfae7bd8c8db47c7db8b20357e4"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"902e9bf3fc045ed66fda66f4d3426b215a5a7e99","unresolved":false,"context_lines":[{"line_number":6688,"context_line":"            server, host_rp_uuid, non_qos_port, qos_port,"},{"line_number":6689,"context_line":"            migration_uuid, source_compute_rp_uuid\u003dself.compute1_rp_uuid)"},{"line_number":6690,"context_line":""},{"line_number":6691,"context_line":"        self.api.post_server_action(server[\u0027id\u0027], {\u0027confirmResize\u0027: None})"},{"line_number":6692,"context_line":"        self._wait_for_migration_status(server, [\u0027confirmed\u0027])"},{"line_number":6693,"context_line":""},{"line_number":6694,"context_line":"        # check that allocation is still OK"},{"line_number":6695,"context_line":"        self._check_allocation(server, host_rp_uuid, non_qos_port, qos_port)"}],"source_content_type":"text/x-python","patch_set":17,"id":"5faad753_54d69e51","line":6692,"range":{"start_line":6691,"start_character":8,"end_line":6692,"end_character":62},"in_reply_to":"5faad753_cfda03e8","updated":"2019-09-11 08:36:07.000000000","message":"Done","commit_id":"7fa66dbd6a539dfae7bd8c8db47c7db8b20357e4"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"14fa040b6bf45699aff6d4cf7c65b3dd16fd4adf","unresolved":false,"context_lines":[{"line_number":6718,"context_line":"            if not prep_resize_calls:"},{"line_number":6719,"context_line":"                prep_resize_calls.append(_self.host)"},{"line_number":6720,"context_line":"                raise test.TestingException(\u0027Simulated prep_resize failure.\u0027)"},{"line_number":6721,"context_line":"            prep_resize_calls.append(_self.host)"},{"line_number":6722,"context_line":"            original_prep_resize(_self, *args, **kwargs)"},{"line_number":6723,"context_line":""},{"line_number":6724,"context_line":"        # Yes this isn\u0027t great in a functional test, but it\u0027s simple."},{"line_number":6725,"context_line":"        original_prep_resize \u003d compute_manager.ComputeManager._prep_resize"}],"source_content_type":"text/x-python","patch_set":17,"id":"5faad753_0fea5b74","line":6722,"range":{"start_line":6721,"start_character":12,"end_line":6722,"end_character":56},"updated":"2019-09-10 18:09:01.000000000","message":"We\u0027ll never actually hit this right? Meaning we could just patch _prep_resize to always raise TestingException below and avoid the separate inner function. It\u0027s not a big deal, just more code than is necessary.","commit_id":"7fa66dbd6a539dfae7bd8c8db47c7db8b20357e4"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"902e9bf3fc045ed66fda66f4d3426b215a5a7e99","unresolved":false,"context_lines":[{"line_number":6718,"context_line":"            if not prep_resize_calls:"},{"line_number":6719,"context_line":"                prep_resize_calls.append(_self.host)"},{"line_number":6720,"context_line":"                raise test.TestingException(\u0027Simulated prep_resize failure.\u0027)"},{"line_number":6721,"context_line":"            prep_resize_calls.append(_self.host)"},{"line_number":6722,"context_line":"            original_prep_resize(_self, *args, **kwargs)"},{"line_number":6723,"context_line":""},{"line_number":6724,"context_line":"        # Yes this isn\u0027t great in a functional test, but it\u0027s simple."},{"line_number":6725,"context_line":"        original_prep_resize \u003d compute_manager.ComputeManager._prep_resize"}],"source_content_type":"text/x-python","patch_set":17,"id":"5faad753_145ee6e5","line":6722,"range":{"start_line":6721,"start_character":12,"end_line":6722,"end_character":56},"in_reply_to":"5faad753_0fea5b74","updated":"2019-09-11 08:36:07.000000000","message":"Done","commit_id":"7fa66dbd6a539dfae7bd8c8db47c7db8b20357e4"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"14fa040b6bf45699aff6d4cf7c65b3dd16fd4adf","unresolved":false,"context_lines":[{"line_number":6745,"context_line":"        # is deleted"},{"line_number":6746,"context_line":"        migration_allocations \u003d self.placement_api.get("},{"line_number":6747,"context_line":"            \u0027/allocations/%s\u0027 % migration_uuid).body[\u0027allocations\u0027]"},{"line_number":6748,"context_line":"        self.assertEqual({}, migration_allocations)"},{"line_number":6749,"context_line":""},{"line_number":6750,"context_line":"        # and the instance is allocation from the source host"},{"line_number":6751,"context_line":"        self._check_allocation("}],"source_content_type":"text/x-python","patch_set":17,"id":"5faad753_6f4f4f92","line":6748,"updated":"2019-09-10 18:09:01.000000000","message":"Hmm, could we race here? The migration allocations are dropped here right?\n\nhttps://github.com/openstack/nova/blob/f4ca3e70852c0a7ed7904a9f2d7177c9118d3d1c/nova/conductor/tasks/migrate.py#L449\n\nor maybe they are dropped on the compute first:\n\nhttps://github.com/openstack/nova/blob/f4ca3e70852c0a7ed7904a9f2d7177c9118d3d1c/nova/compute/manager.py#L4505\n\nand above we\u0027re waiting for the migration status to be \u0027error\u0027 which happens here:\n\nhttps://github.com/openstack/nova/blob/f4ca3e70852c0a7ed7904a9f2d7177c9118d3d1c/nova/conductor/tasks/migrate.py#L437\n\nor maybe here in the compute:\n\nhttps://github.com/openstack/nova/blob/f4ca3e70852c0a7ed7904a9f2d7177c9118d3d1c/nova/compute/manager.py#L4492\n\nIf the migration is set to error status in the compute then we should be OK because compute reverts the allocations before we hit errors_out_migration_ctxt.","commit_id":"7fa66dbd6a539dfae7bd8c8db47c7db8b20357e4"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"902e9bf3fc045ed66fda66f4d3426b215a5a7e99","unresolved":false,"context_lines":[{"line_number":6745,"context_line":"        # is deleted"},{"line_number":6746,"context_line":"        migration_allocations \u003d self.placement_api.get("},{"line_number":6747,"context_line":"            \u0027/allocations/%s\u0027 % migration_uuid).body[\u0027allocations\u0027]"},{"line_number":6748,"context_line":"        self.assertEqual({}, migration_allocations)"},{"line_number":6749,"context_line":""},{"line_number":6750,"context_line":"        # and the instance is allocation from the source host"},{"line_number":6751,"context_line":"        self._check_allocation("}],"source_content_type":"text/x-python","patch_set":17,"id":"5faad753_14ba66dd","line":6748,"in_reply_to":"5faad753_6f4f4f92","updated":"2019-09-11 08:36:07.000000000","message":"The migration allocation dropped on the compute as well as erroring out the migration. But the error out happens after the allocation is deleted so we are not racing here.","commit_id":"7fa66dbd6a539dfae7bd8c8db47c7db8b20357e4"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"14fa040b6bf45699aff6d4cf7c65b3dd16fd4adf","unresolved":false,"context_lines":[{"line_number":6747,"context_line":"            \u0027/allocations/%s\u0027 % migration_uuid).body[\u0027allocations\u0027]"},{"line_number":6748,"context_line":"        self.assertEqual({}, migration_allocations)"},{"line_number":6749,"context_line":""},{"line_number":6750,"context_line":"        # and the instance is allocation from the source host"},{"line_number":6751,"context_line":"        self._check_allocation("},{"line_number":6752,"context_line":"            server, self.compute1_rp_uuid, non_qos_port, qos_port)"},{"line_number":6753,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"5faad753_cf5f633f","line":6750,"range":{"start_line":6750,"start_character":27,"end_line":6750,"end_character":40},"updated":"2019-09-10 18:09:01.000000000","message":"is allocated? allocates?","commit_id":"7fa66dbd6a539dfae7bd8c8db47c7db8b20357e4"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"902e9bf3fc045ed66fda66f4d3426b215a5a7e99","unresolved":false,"context_lines":[{"line_number":6747,"context_line":"            \u0027/allocations/%s\u0027 % migration_uuid).body[\u0027allocations\u0027]"},{"line_number":6748,"context_line":"        self.assertEqual({}, migration_allocations)"},{"line_number":6749,"context_line":""},{"line_number":6750,"context_line":"        # and the instance is allocation from the source host"},{"line_number":6751,"context_line":"        self._check_allocation("},{"line_number":6752,"context_line":"            server, self.compute1_rp_uuid, non_qos_port, qos_port)"},{"line_number":6753,"context_line":""}],"source_content_type":"text/x-python","patch_set":17,"id":"5faad753_34a202b0","line":6750,"range":{"start_line":6750,"start_character":27,"end_line":6750,"end_character":40},"in_reply_to":"5faad753_cf5f633f","updated":"2019-09-11 08:36:07.000000000","message":"Done","commit_id":"7fa66dbd6a539dfae7bd8c8db47c7db8b20357e4"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"be5b5b928af22f9741b28c6d142ab22bef45391a","unresolved":false,"context_lines":[{"line_number":6650,"context_line":"        # first host of the migration. Then the migration"},{"line_number":6651,"context_line":"        # is reschedule on the other host where it will succeed"},{"line_number":6652,"context_line":"        with mock.patch.object("},{"line_number":6653,"context_line":"                compute_manager.ComputeManager, \u0027_prep_resize\u0027,"},{"line_number":6654,"context_line":"                new\u003dfake_prep_resize):"},{"line_number":6655,"context_line":"            self.api.post_server_action(server[\u0027id\u0027], {\u0027migrate\u0027: None})"},{"line_number":6656,"context_line":"            self._wait_for_state_change(self.api, server, \u0027VERIFY_RESIZE\u0027)"},{"line_number":6657,"context_line":""}],"source_content_type":"text/x-python","patch_set":18,"id":"5faad753_bad8147f","line":6654,"range":{"start_line":6653,"start_character":16,"end_line":6654,"end_character":36},"updated":"2019-09-11 13:00:51.000000000","message":"Probably could have also just done something like this:\n\nwith mock.patch.object(\n    self.computes[\u0027host2\u0027].manager, \u0027_prep_resize\u0027,\n    side_effect\u003dtest.TestingException(...)):","commit_id":"57eaaa9680ab260eef79f70656dfbc9de3fab0ff"}]}
