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
Azure - nightly functional - Fix for resource group and Cosmos #4748
Azure - nightly functional - Fix for resource group and Cosmos #4748
Conversation
@@ -301,7 +301,14 @@ def _replace_subscription_id(s): | |||
r"[\da-zA-Z]{8}-([\da-zA-Z]{4}-){3}[\da-zA-Z]{12}" \ | |||
% '|'.join(['(%s)' % p for p in prefixes]) | |||
|
|||
return re.sub(regex, r"\g<prefix>" + DEFAULT_SUBSCRIPTION_ID, s) | |||
match = re.search(regex, s) | |||
s = re.sub(regex, r"\g<prefix>" + DEFAULT_SUBSCRIPTION_ID, s) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: I wonder if re.sub
is the same as s.replace(re.search(regex, s), NEW)
anyway. e.g. can we replace this line with s = s.replace(match, r"\g<prefix>" + DEFAULT_SUBSCRIPTION_ID)
to avoid doing the regex search twice. The method runs a very large number of times so might have some measurable impact.
self.assertEqual(throughput, offer['content']['offerThroughput']) | ||
|
||
|
||
def live_session_wait(): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking we could add this to BaseTest
in azure_common.py
- most methods there already check if self.is_playback():
so we could have def test_sleep(self, interval)
that does nothing if self.is_playback()
- then it'll run during cassette recording or live tests only. I'm sure others will end up needing it eventually.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I named the functions sleep_in_live_mode
. I tried test_sleep
but then it got picked up as a test for each running class, which added a ton of time
max-resource-percent
for test to be valid for the large number of resource groups in a functional test