)]}'
{"neutron/plugins/ml2/drivers/helpers.py":[{"author":{"_account_id":32349,"name":"Thiago Paiva Brito","email":"thiago.brito@windriver.com","username":"outbrito"},"change_message_id":"3175a4068249bebab4ef110549004e2fda937a50","unresolved":true,"context_lines":[{"line_number":125,"context_line":"        Return allocated db object or None."},{"line_number":126,"context_line":"        \"\"\""},{"line_number":127,"context_line":"        network_type \u003d self.get_type()"},{"line_number":128,"context_line":"        if directory.get_plugin(plugin_constants.NETWORK_SEGMENT_RANGE):"},{"line_number":129,"context_line":"            calls \u003d ["},{"line_number":130,"context_line":"                functools.partial("},{"line_number":131,"context_line":"                    ns_range.NetworkSegmentRange.get_segments_for_project,"}],"source_content_type":"text/x-python","patch_set":1,"id":"166ad931_7db8ace8","side":"PARENT","line":128,"updated":"2021-08-09 20:48:42.000000000","message":"We are using the \"directory\" to check if the plugin is enabled here, but the test never takes care to actually add the segments plugin to the directory.","commit_id":"f48b43c6cb840066b880c1abcd384b618fc7577c"}],"neutron/tests/unit/plugins/ml2/drivers/test_helpers.py":[{"author":{"_account_id":32349,"name":"Thiago Paiva Brito","email":"thiago.brito@windriver.com","username":"outbrito"},"change_message_id":"3175a4068249bebab4ef110549004e2fda937a50","unresolved":true,"context_lines":[{"line_number":150,"context_line":"                              group\u003d\u0027ml2_type_vlan\u0027)"},{"line_number":151,"context_line":"        cfg.CONF.set_override(\u0027service_plugins\u0027, [SERVICE_PLUGIN_KLASS])"},{"line_number":152,"context_line":"        self.plugin \u003d mock.MagicMock()"},{"line_number":153,"context_line":"        directory.add_plugin(plugin_constants.NETWORK_SEGMENT_RANGE, self.plugin)"},{"line_number":154,"context_line":"        self.network_vlan_ranges \u003d plugin_utils.parse_network_vlan_ranges("},{"line_number":155,"context_line":"            NETWORK_VLAN_RANGES_CFG_ENTRIES)"},{"line_number":156,"context_line":"        self.context \u003d context.get_admin_context()"}],"source_content_type":"text/x-python","patch_set":1,"id":"546a9f32_00835ba4","line":153,"updated":"2021-08-09 20:48:42.000000000","message":"Since the plugin wasn\u0027t properly enabled (at least as we check it on helpers.py), this class was pretty much repeating all the tests on it\u0027s base class.","commit_id":"316d372158f04737d457d9d72ba20e7f85213eb4"},{"author":{"_account_id":24777,"name":"Steven Webster","email":"steven.webster@windriver.com","username":"swebster"},"change_message_id":"beef2652de941f8862f12991380ca9d218310de3","unresolved":true,"context_lines":[{"line_number":150,"context_line":"                              group\u003d\u0027ml2_type_vlan\u0027)"},{"line_number":151,"context_line":"        cfg.CONF.set_override(\u0027service_plugins\u0027, [SERVICE_PLUGIN_KLASS])"},{"line_number":152,"context_line":"        self.plugin \u003d mock.MagicMock()"},{"line_number":153,"context_line":"        directory.add_plugin(plugin_constants.NETWORK_SEGMENT_RANGE, self.plugin)"},{"line_number":154,"context_line":"        self.network_vlan_ranges \u003d plugin_utils.parse_network_vlan_ranges("},{"line_number":155,"context_line":"            NETWORK_VLAN_RANGES_CFG_ENTRIES)"},{"line_number":156,"context_line":"        self.context \u003d context.get_admin_context()"}],"source_content_type":"text/x-python","patch_set":1,"id":"e4c31e2b_c3ac1c6a","line":153,"in_reply_to":"546a9f32_00835ba4","updated":"2021-08-09 21:35:28.000000000","message":"Would it also work to do something like:\n\nhttps://github.com/openstack/neutron/blob/master/neutron/tests/unit/services/network_segment_range/test_plugin.py#L90\n\nAlso check out other tests like\n\nVlanTypeTestWithNetworkSegmentRange\nTunnelTypeNetworkSegmentRangeTestMixin\n\nDo you think these are returning false positives as well?","commit_id":"316d372158f04737d457d9d72ba20e7f85213eb4"},{"author":{"_account_id":32349,"name":"Thiago Paiva Brito","email":"thiago.brito@windriver.com","username":"outbrito"},"change_message_id":"bc649ee797a33b9b4cb6a399b4360fb5a85b045c","unresolved":true,"context_lines":[{"line_number":150,"context_line":"                              group\u003d\u0027ml2_type_vlan\u0027)"},{"line_number":151,"context_line":"        cfg.CONF.set_override(\u0027service_plugins\u0027, [SERVICE_PLUGIN_KLASS])"},{"line_number":152,"context_line":"        self.plugin \u003d mock.MagicMock()"},{"line_number":153,"context_line":"        directory.add_plugin(plugin_constants.NETWORK_SEGMENT_RANGE, self.plugin)"},{"line_number":154,"context_line":"        self.network_vlan_ranges \u003d plugin_utils.parse_network_vlan_ranges("},{"line_number":155,"context_line":"            NETWORK_VLAN_RANGES_CFG_ENTRIES)"},{"line_number":156,"context_line":"        self.context \u003d context.get_admin_context()"}],"source_content_type":"text/x-python","patch_set":1,"id":"20e74a80_18e20ce9","line":153,"in_reply_to":"e4c31e2b_c3ac1c6a","updated":"2021-08-10 13:22:04.000000000","message":"Will check.","commit_id":"316d372158f04737d457d9d72ba20e7f85213eb4"},{"author":{"_account_id":32349,"name":"Thiago Paiva Brito","email":"thiago.brito@windriver.com","username":"outbrito"},"change_message_id":"3175a4068249bebab4ef110549004e2fda937a50","unresolved":true,"context_lines":[{"line_number":158,"context_line":"        self.driver.initialize_network_segment_range_support()"},{"line_number":159,"context_line":"        self.driver._sync_vlan_allocations()"},{"line_number":160,"context_line":""},{"line_number":161,"context_line":"    def test_allocate_partial_segment_first_attempt_fails(self):"},{"line_number":162,"context_line":"        expected \u003d dict(physical_network\u003dTENANT_NET)"},{"line_number":163,"context_line":"        with mock.patch.object(query.Query, \u0027update\u0027, side_effect\u003d[0, 1]):"},{"line_number":164,"context_line":"            observed \u003d self.driver.allocate_partially_specified_segment("}],"source_content_type":"text/x-python","patch_set":1,"id":"c8a04e92_e5fe63bd","line":161,"updated":"2021-08-09 20:48:42.000000000","message":"This test is a duplicate of the one on Line 132 that, IMO, is working under false premises. When we get a list of segments to choose from, and the first segment is already allocated, it fails right away with the RetryRequest exception, the the other segments are never tried out.\n\nThis actually works at master due to a side effect of a refactoring that was done on https://opendev.org/openstack/neutron/commit/6eaa6d83d7c7f07fd4bf04879c91582de504eff4 to randomize the selection of segments.","commit_id":"316d372158f04737d457d9d72ba20e7f85213eb4"},{"author":{"_account_id":32349,"name":"Thiago Paiva Brito","email":"thiago.brito@windriver.com","username":"outbrito"},"change_message_id":"bc649ee797a33b9b4cb6a399b4360fb5a85b045c","unresolved":true,"context_lines":[{"line_number":158,"context_line":"        self.driver.initialize_network_segment_range_support()"},{"line_number":159,"context_line":"        self.driver._sync_vlan_allocations()"},{"line_number":160,"context_line":""},{"line_number":161,"context_line":"    def test_allocate_partial_segment_first_attempt_fails(self):"},{"line_number":162,"context_line":"        expected \u003d dict(physical_network\u003dTENANT_NET)"},{"line_number":163,"context_line":"        with mock.patch.object(query.Query, \u0027update\u0027, side_effect\u003d[0, 1]):"},{"line_number":164,"context_line":"            observed \u003d self.driver.allocate_partially_specified_segment("}],"source_content_type":"text/x-python","patch_set":1,"id":"4fd6c95a_13d3495a","line":161,"in_reply_to":"127112d5_989050e0","updated":"2021-08-10 13:22:04.000000000","message":"Not until we try to allocate all available segments. On this specific case, I reduced the segments to two (200 and 201) and kicked a side_effect on the first attempt to test if it would try to allocate the second one. If both failed, we would indeed get the RetryRequest, as intended.","commit_id":"316d372158f04737d457d9d72ba20e7f85213eb4"},{"author":{"_account_id":24777,"name":"Steven Webster","email":"steven.webster@windriver.com","username":"swebster"},"change_message_id":"beef2652de941f8862f12991380ca9d218310de3","unresolved":true,"context_lines":[{"line_number":158,"context_line":"        self.driver.initialize_network_segment_range_support()"},{"line_number":159,"context_line":"        self.driver._sync_vlan_allocations()"},{"line_number":160,"context_line":""},{"line_number":161,"context_line":"    def test_allocate_partial_segment_first_attempt_fails(self):"},{"line_number":162,"context_line":"        expected \u003d dict(physical_network\u003dTENANT_NET)"},{"line_number":163,"context_line":"        with mock.patch.object(query.Query, \u0027update\u0027, side_effect\u003d[0, 1]):"},{"line_number":164,"context_line":"            observed \u003d self.driver.allocate_partially_specified_segment("}],"source_content_type":"text/x-python","patch_set":1,"id":"127112d5_989050e0","line":161,"in_reply_to":"c8a04e92_e5fe63bd","updated":"2021-08-09 21:35:28.000000000","message":"So in this case you _wouldn\u0027t_ get a RetryRequest exception?","commit_id":"316d372158f04737d457d9d72ba20e7f85213eb4"}]}
