Use new network for each subnet scenario run

Using _get_or_create_network was resulting in all concurrent
runners creating/updating/deleting subnets on a single Neutron
network. This was problematic for two reasons.

First, a network in Neutron in any normal deployment does not
have that many concurrent subnet create/update/deletes happening
on it at once because networks very rarely have more than 1 or 2
subnets on them.

Second, it made it appear as though Neutron was having
performance problems for handling lots of concurrent subnet
requests because Neutron internally performs overlapping checks
for subnets within a given network.

So we weren't getting performance measurements for normal heavy
usage (lots of subnet activity across lots of different networks)
and we were getting performance measurements for a non-standard
case (significant subnet activity within a single network).

This adjusts the scenario to always create a network for each
test run, which brings it inline with normal heavy use deployment
behavior.

Change-Id: I254dbd166a79ca07e18a61da92bc536b035452e1
This commit is contained in:
Kevin Benton 2017-01-26 03:05:44 -08:00
parent cda333bf52
commit ed6451d78c
2 changed files with 6 additions and 6 deletions

View File

@ -116,7 +116,7 @@ class CreateAndListSubnets(utils.NeutronScenario):
:param subnet_cidr_start: str, start value for subnets CIDR
:param subnets_per_network: int, number of subnets for one network
"""
network = self._get_or_create_network(network_create_args)
network = self._create_network(network_create_args or {})
self._create_subnets(network, subnet_create_args, subnet_cidr_start,
subnets_per_network)
self._list_subnets()
@ -145,7 +145,7 @@ class CreateAndUpdateSubnets(utils.NeutronScenario):
:param subnet_cidr_start: str, start value for subnets CIDR
:param subnets_per_network: int, number of subnets for one network
"""
network = self._get_or_create_network(network_create_args)
network = self._create_network(network_create_args or {})
subnets = self._create_subnets(network, subnet_create_args,
subnet_cidr_start, subnets_per_network)

View File

@ -141,7 +141,7 @@ class NeutronNetworksTestCase(test.ScenarioTestCase):
net = mock.MagicMock()
scenario = network.CreateAndListSubnets(self.context)
scenario._get_or_create_network = mock.Mock(return_value=net)
scenario._create_network = mock.Mock(return_value=net)
scenario._create_subnets = mock.Mock()
scenario._list_subnets = mock.Mock()
@ -150,7 +150,7 @@ class NeutronNetworksTestCase(test.ScenarioTestCase):
subnet_cidr_start=subnet_cidr_start,
subnets_per_network=subnets_per_network)
scenario._get_or_create_network.assert_called_once_with(
scenario._create_network.assert_called_once_with(
network_create_args)
scenario._create_subnets.assert_called_once_with(
net, subnet_create_args, subnet_cidr_start, subnets_per_network)
@ -167,7 +167,7 @@ class NeutronNetworksTestCase(test.ScenarioTestCase):
subnets = [mock.MagicMock() for _ in range(subnets_per_network)]
scenario = network.CreateAndUpdateSubnets(self.context)
scenario._get_or_create_network = mock.Mock(return_value=net)
scenario._create_network = mock.Mock(return_value=net)
scenario._create_subnets = mock.Mock(return_value=subnets)
scenario._update_subnet = mock.Mock()
@ -177,7 +177,7 @@ class NeutronNetworksTestCase(test.ScenarioTestCase):
subnet_cidr_start=subnet_cidr_start,
subnets_per_network=subnets_per_network)
scenario._get_or_create_network.assert_called_once_with(
scenario._create_network.assert_called_once_with(
network_create_args)
scenario._create_subnets.assert_called_once_with(
net, subnet_create_args, subnet_cidr_start, subnets_per_network)