Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make stage name randomized to avoid race condition among multi canary… #3078

Merged
merged 1 commit into from
Jul 19, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion tests/integration/pipeline/base.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os
import shutil
import logging
import uuid
from pathlib import Path
from typing import List, Optional, Set, Tuple, Any
from unittest import TestCase
Expand Down Expand Up @@ -54,10 +55,12 @@ class BootstrapIntegBase(PipelineBase):
region = "us-east-1"
stack_names: List[str]
cf_client: Any
randomized_stage_suffix: str

@classmethod
def setUpClass(cls):
cls.cf_client = boto3.client("cloudformation", region_name=cls.region)
cls.randomized_stage_suffix = uuid.uuid4().hex[-6:]

def setUp(self):
self.stack_names = []
Expand Down Expand Up @@ -142,7 +145,7 @@ def _stack_exists(self, stack_name) -> bool:
def _get_stage_and_stack_name(self, suffix: str = "") -> Tuple[str, str]:
# Method expects method name which can be a full path. Eg: test.integration.test_bootstrap_command.method_name
method_name = self.id().split(".")[-1]
stage_name = method_name.replace("_", "-") + suffix
stage_name = method_name.replace("_", "-") + suffix + "-" + self.randomized_stage_suffix

mock_env = Mock()
mock_env.name = stage_name
Expand Down