From 56e4dbcdfa87b7c8b209fb5eccf09fcae55cf8f3 Mon Sep 17 00:00:00 2001 From: "James E. Blair" Date: Tue, 30 Jul 2024 13:02:59 -0700 Subject: [PATCH] Fix mock aws teardown in awskinesis tests We need to stop AWS after the rest of the test shutdown procedure, otherwise we will attempt to make unauthenticated calls to AWS. This change adjusts the shutdown order in the aws kinesis tests to run the mock aws shutdown last. Change-Id: Ie50db58f7271a85da1e47fc4faeb0133013d1296 --- tests/unit/test_gerrit_awskinesis.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tests/unit/test_gerrit_awskinesis.py b/tests/unit/test_gerrit_awskinesis.py index 7b56b008df..40cb85e500 100644 --- a/tests/unit/test_gerrit_awskinesis.py +++ b/tests/unit/test_gerrit_awskinesis.py @@ -50,12 +50,9 @@ class TestGerritEventSourceAWSKinesis(ZuulTestCase): 'StreamMode': 'ON_DEMAND' } ) + self.addCleanup(self.mock_aws.stop) super().setUp() - def tearDown(self): - self.mock_aws.stop() - super().tearDown() - @simple_layout('layouts/simple.yaml') def test_kinesis(self): listener = self.fake_gerrit.event_thread