Skip to content

Commit

Permalink
only check logs after scenario startS
Browse files Browse the repository at this point in the history
  • Loading branch information
maddieford committed Nov 7, 2023
1 parent 6ae88f0 commit c5e79ae
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion tests_e2e/tests/ext_sequencing/ext_sequencing.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ class ExtSequencing(AgentVmssTest):
add_failing_dependent_extension_with_two_dependencies
]

_scenario_start = datetime.min

@staticmethod
def _get_dependency_map(extensions: List[Dict[str, Any]]) -> Dict[str, Dict[str, Any]]:
dependency_map: Dict[str, Dict[str, Any]] = dict()
Expand Down Expand Up @@ -176,6 +178,8 @@ def run(self):

for case in self._test_cases:
test_case_start = datetime.now()
if self._scenario_start == datetime.min:
self._scenario_start = test_case_start

# Assign unique guid to forceUpdateTag for each extension to make sure they're always unique to force CRP
# to generate a new sequence number each time
Expand Down Expand Up @@ -212,7 +216,8 @@ def run(self):
rg_client.deploy_template(template=ext_template)
except Exception as e:
# We only expect to catch an exception during deployment if we are forcing one of the extensions to
# fail. Otherwise, report the failure.
# fail. We know an extension should fail if "failing" is in the case name. Otherwise, report the
# failure.
deployment_failure_pattern = r"[\s\S]*\"details\": [\s\S]* \"code\": \"(?P<code>.*)\"[\s\S]* \"message\": \"(?P<msg>.*)\"[\s\S]*"
msg_pattern = r"Multiple VM extensions failed to be provisioned on the VM. Please see the VM extension instance view for other failures. The first extension failed due to the error: VM Extension '.*' is marked as failed since it depends upon the VM Extension 'CustomScript' which has failed."
deployment_failure_match = re.match(deployment_failure_pattern, str(e))
Expand Down Expand Up @@ -241,6 +246,10 @@ def run(self):

log.info("------")

def get_ignore_errors_before_timestamp(self) -> datetime:
# Ignore errors in the agent log before the first test case starts
return self._scenario_start

def get_ignore_error_rules(self) -> List[Dict[str, Any]]:
ignore_rules = [
#
Expand Down

0 comments on commit c5e79ae

Please sign in to comment.