From ea44afa071f3765c14f4723da6c914ed1414bd1c Mon Sep 17 00:00:00 2001 From: Kieran Brantner-Magee Date: Thu, 1 Oct 2020 22:41:26 -0700 Subject: [PATCH 1/3] See if we can identify why the preparer is going sideways with the cosmos changes in CI. --- .../src/azure_devtools/scenario_tests/preparers.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools/azure-devtools/src/azure_devtools/scenario_tests/preparers.py b/tools/azure-devtools/src/azure_devtools/scenario_tests/preparers.py index 7ba736fec903..ee866153c63d 100644 --- a/tools/azure-devtools/src/azure_devtools/scenario_tests/preparers.py +++ b/tools/azure-devtools/src/azure_devtools/scenario_tests/preparers.py @@ -44,6 +44,9 @@ def _prepare_create_resource(self, test_class_instance, **kwargs): # If the first cached test run does not have any http traffic, a recording will not have been # generated, so in_recording will be True even if live_test is false, so a random name would be given. # In cached mode we need to avoid this because then for tests with recordings, they would not have a moniker. + print("LIVE TEST: " + str(self.live_test)) + print("IN RECORDING: " + str(test_class_instance.in_recording)) + print("USE CACHE: " + str(self._use_cache)) if (self.live_test or test_class_instance.in_recording) \ and not (not self.live_test and test_class_instance.in_recording and self._use_cache): resource_name = self.random_name From 93c11eb7cb3df250da757b116c17f17bc5ea8202 Mon Sep 17 00:00:00 2001 From: Kieran Brantner-Magee Date: Thu, 1 Oct 2020 23:51:22 -0700 Subject: [PATCH 2/3] try using testclassinstance islive as a more proper approach. if this doesn't work, may try a devtoolsutils import in a try catch as a final hail mairy for is_live() to match the decorator itself. --- .../src/azure_devtools/scenario_tests/preparers.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tools/azure-devtools/src/azure_devtools/scenario_tests/preparers.py b/tools/azure-devtools/src/azure_devtools/scenario_tests/preparers.py index ee866153c63d..6e3671202d26 100644 --- a/tools/azure-devtools/src/azure_devtools/scenario_tests/preparers.py +++ b/tools/azure-devtools/src/azure_devtools/scenario_tests/preparers.py @@ -44,11 +44,11 @@ def _prepare_create_resource(self, test_class_instance, **kwargs): # If the first cached test run does not have any http traffic, a recording will not have been # generated, so in_recording will be True even if live_test is false, so a random name would be given. # In cached mode we need to avoid this because then for tests with recordings, they would not have a moniker. - print("LIVE TEST: " + str(self.live_test)) + print("LIVE TEST: " + str(test_class_instance.is_live)) print("IN RECORDING: " + str(test_class_instance.in_recording)) print("USE CACHE: " + str(self._use_cache)) if (self.live_test or test_class_instance.in_recording) \ - and not (not self.live_test and test_class_instance.in_recording and self._use_cache): + and not (not test_class_instance.is_live and test_class_instance.in_recording and self._use_cache): resource_name = self.random_name if not self.live_test and isinstance(self, RecordingProcessor): test_class_instance.recording_processors.append(self) From c95db8ecfbd417c5f1627aef9a240b9e01de1898 Mon Sep 17 00:00:00 2001 From: Kieran Brantner-Magee Date: Fri, 2 Oct 2020 13:48:20 -0700 Subject: [PATCH 3/3] Remove debug prints from preparer hotfix --- .../src/azure_devtools/scenario_tests/preparers.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/tools/azure-devtools/src/azure_devtools/scenario_tests/preparers.py b/tools/azure-devtools/src/azure_devtools/scenario_tests/preparers.py index 6e3671202d26..7496b5de5de6 100644 --- a/tools/azure-devtools/src/azure_devtools/scenario_tests/preparers.py +++ b/tools/azure-devtools/src/azure_devtools/scenario_tests/preparers.py @@ -44,9 +44,6 @@ def _prepare_create_resource(self, test_class_instance, **kwargs): # If the first cached test run does not have any http traffic, a recording will not have been # generated, so in_recording will be True even if live_test is false, so a random name would be given. # In cached mode we need to avoid this because then for tests with recordings, they would not have a moniker. - print("LIVE TEST: " + str(test_class_instance.is_live)) - print("IN RECORDING: " + str(test_class_instance.in_recording)) - print("USE CACHE: " + str(self._use_cache)) if (self.live_test or test_class_instance.in_recording) \ and not (not test_class_instance.is_live and test_class_instance.in_recording and self._use_cache): resource_name = self.random_name