Fix cleanup process in AWS tests
This moves the moto stop from a teardown to a cleanup. This is necessary so that we don't stop moto before we shut down the test nodepool. The current code mostly works, but exhibits problems in tests with unusual shutdown timings. Change-Id: Ia457389ae297317dfe2c120f83f9d93a024f4abc
This commit is contained in:
@@ -160,6 +160,7 @@ class TestDriverAws(tests.DBTestCase):
|
||||
|
||||
self.fake_aws = FakeAws()
|
||||
self.mock_aws.start()
|
||||
self.addCleanup(self.mock_aws.stop)
|
||||
|
||||
self.ec2 = boto3.resource('ec2', region_name='us-west-2')
|
||||
self.ec2_client = boto3.client('ec2', region_name='us-west-2')
|
||||
@@ -212,10 +213,6 @@ class TestDriverAws(tests.DBTestCase):
|
||||
self.patchAdapter(ec2_quotas=getattr(test, '__aws_ec2_quotas__', None),
|
||||
ebs_quotas=getattr(test, '__aws_ebs_quotas__', None))
|
||||
|
||||
def tearDown(self):
|
||||
self.mock_aws.stop()
|
||||
super().tearDown()
|
||||
|
||||
def setup_config(self, *args, **kw):
|
||||
kw['subnet_id'] = self.subnet_id
|
||||
kw['security_group_id'] = self.security_group_id
|
||||
|
||||
Reference in New Issue
Block a user