You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@libcloud.apache.org by GitBox <gi...@apache.org> on 2021/10/22 17:59:07 UTC

[GitHub] [libcloud] Kami opened a new pull request #1617: Clean up old / stray resources before the test run

Kami opened a new pull request #1617:
URL: https://github.com/apache/libcloud/pull/1617


   This pull request updates Azure Blobs integration test class so we clean any old stray resource groups left from previous test runs before we actually run the tests.
   
   This should ensure we don't have any limits and we delete any stray resources from previous runs (we can end up with stray resources if the CI build is terminated non-gracefully and ``tearDownClass`` has no chance to run).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@libcloud.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [libcloud] Kami commented on pull request #1617: Clean up old / stray resources before the test run

Posted by GitBox <gi...@apache.org>.
Kami commented on pull request #1617:
URL: https://github.com/apache/libcloud/pull/1617#issuecomment-949951735


   I noticed some test cases took almost 100 seconds, so I pushed a change which should speed it up - d31e3ee65768dbaa05bf85f85feb90c20f64749b, bbcaa2748fa96c607b6ac8252aff415ac30facbe.
   
   This will substantially reduce number of iterations (previously for some test cases we used 1 * 1024 * 1024 iterations which will be slow), but there will still be multiple ones so that iteration / chunk upload functionality will still be tested.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@libcloud.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [libcloud] codecov-commenter edited a comment on pull request #1617: Clean up old / stray resources before the test run

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1617:
URL: https://github.com/apache/libcloud/pull/1617#issuecomment-949853125


   # [Codecov](https://codecov.io/gh/apache/libcloud/pull/1617?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#1617](https://codecov.io/gh/apache/libcloud/pull/1617?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (b973182) into [trunk](https://codecov.io/gh/apache/libcloud/commit/24ef735ac327e8f6276d5b8883a4d367462733ac?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (24ef735) will **increase** coverage by `0.00%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/libcloud/pull/1617/graphs/tree.svg?width=650&height=150&src=pr&token=PYoduksh69&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/libcloud/pull/1617?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@           Coverage Diff           @@
   ##            trunk    #1617   +/-   ##
   =======================================
     Coverage   83.02%   83.02%           
   =======================================
     Files         394      394           
     Lines       85269    85269           
     Branches     9070     9070           
   =======================================
   + Hits        70795    70797    +2     
   + Misses      11390    11389    -1     
   + Partials     3084     3083    -1     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/libcloud/pull/1617?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [libcloud/test/dns/test\_base.py](https://codecov.io/gh/apache/libcloud/pull/1617/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-bGliY2xvdWQvdGVzdC9kbnMvdGVzdF9iYXNlLnB5) | `100.00% <0.00%> (+2.98%)` | :arrow_up: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/libcloud/pull/1617?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/libcloud/pull/1617?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [24ef735...b973182](https://codecov.io/gh/apache/libcloud/pull/1617?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@libcloud.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [libcloud] codecov-commenter edited a comment on pull request #1617: Clean up old / stray resources before the test run

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1617:
URL: https://github.com/apache/libcloud/pull/1617#issuecomment-949853125


   # [Codecov](https://codecov.io/gh/apache/libcloud/pull/1617?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#1617](https://codecov.io/gh/apache/libcloud/pull/1617?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (049ac90) into [trunk](https://codecov.io/gh/apache/libcloud/commit/24ef735ac327e8f6276d5b8883a4d367462733ac?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (24ef735) will **not change** coverage.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/libcloud/pull/1617/graphs/tree.svg?width=650&height=150&src=pr&token=PYoduksh69&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/libcloud/pull/1617?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@           Coverage Diff           @@
   ##            trunk    #1617   +/-   ##
   =======================================
     Coverage   83.02%   83.02%           
   =======================================
     Files         394      394           
     Lines       85269    85269           
     Branches     9070     9070           
   =======================================
     Hits        70795    70795           
     Misses      11390    11390           
     Partials     3084     3084           
   ```
   
   
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/libcloud/pull/1617?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/libcloud/pull/1617?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [24ef735...049ac90](https://codecov.io/gh/apache/libcloud/pull/1617?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@libcloud.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [libcloud] Kami commented on pull request #1617: Clean up old / stray resources before the test run

Posted by GitBox <gi...@apache.org>.
Kami commented on pull request #1617:
URL: https://github.com/apache/libcloud/pull/1617#issuecomment-949937179


   @c-w Thanks for the review.
   
   I pushed some more changes and fixes and I believe it should be working now. I also reverted the testing change to allow for concurrent runs.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@libcloud.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [libcloud] c-w commented on a change in pull request #1617: Clean up old / stray resources before the test run

Posted by GitBox <gi...@apache.org>.
c-w commented on a change in pull request #1617:
URL: https://github.com/apache/libcloud/pull/1617#discussion_r734750067



##########
File path: integration/storage/test_azure_blobs.py
##########
@@ -128,12 +129,35 @@ def setUpClass(cls):
         name += random_string(MAX_STORAGE_ACCOUNT_NAME_LENGTH - len(name))
         timeout = float(os.getenv('AZURE_TIMEOUT_SECONDS', DEFAULT_TIMEOUT_SECONDS))
 
+        # We clean up any left over resource groups from previous runs on setUpClass. If tests on
+        # CI get terminated non-gracefully, old resources will be left laying around and we want
+        # to clean those up to ensure we dont hit any limits.
+        # To avoid deleting groups from concurrent runs, we only delete resources older than a
+        # couple (6) of hours
+        resource_groups = resource_client.resource_groups.list()
+        now_ts = int(time.time())
+        delete_threshold_ts = now_ts - (6 * 60 * 60)
+
+        for resource_group in resource_groups:
+            resource_create_ts = resource_groups.tags.get('create_ts', now_ts)
+
+            if resource_group.name.startswith(name) and resource_group.location == location and \
+               'test' in resource_groups.tags and resource_create_ts <= delete_threshold_ts:
+               #'test' in resource_groups.tags and resource_create_ts <= delete_threshold_ts:

Review comment:
       Nit: remove comment before merge.

##########
File path: integration/storage/test_azure_blobs.py
##########
@@ -128,12 +129,35 @@ def setUpClass(cls):
         name += random_string(MAX_STORAGE_ACCOUNT_NAME_LENGTH - len(name))
         timeout = float(os.getenv('AZURE_TIMEOUT_SECONDS', DEFAULT_TIMEOUT_SECONDS))
 
+        # We clean up any left over resource groups from previous runs on setUpClass. If tests on
+        # CI get terminated non-gracefully, old resources will be left laying around and we want
+        # to clean those up to ensure we dont hit any limits.
+        # To avoid deleting groups from concurrent runs, we only delete resources older than a
+        # couple (6) of hours
+        resource_groups = resource_client.resource_groups.list()
+        now_ts = int(time.time())
+        delete_threshold_ts = now_ts - (6 * 60 * 60)
+
+        for resource_group in resource_groups:
+            resource_create_ts = resource_groups.tags.get('create_ts', now_ts)
+
+            if resource_group.name.startswith(name) and resource_group.location == location and \
+               'test' in resource_groups.tags and resource_create_ts <= delete_threshold_ts:
+               #'test' in resource_groups.tags and resource_create_ts <= delete_threshold_ts:
+                print("Deleting old stray resource group: %s..." % (resource_group.name))
+
+                try:
+                    resource_client.resource_groups.begin_delete(resource_group.name)
+                except Exception as e:
+                    print("Failed to delete resource group: %s" % (str(e)))

Review comment:
       Nit: suggest to log to stderr so it gets highlighted in the logs: `from sys import stderr; print("Failed to delete resource group: %s" % (str(e)), file=stderr)`

##########
File path: integration/storage/test_azure_blobs.py
##########
@@ -128,12 +129,35 @@ def setUpClass(cls):
         name += random_string(MAX_STORAGE_ACCOUNT_NAME_LENGTH - len(name))
         timeout = float(os.getenv('AZURE_TIMEOUT_SECONDS', DEFAULT_TIMEOUT_SECONDS))
 
+        # We clean up any left over resource groups from previous runs on setUpClass. If tests on
+        # CI get terminated non-gracefully, old resources will be left laying around and we want
+        # to clean those up to ensure we dont hit any limits.
+        # To avoid deleting groups from concurrent runs, we only delete resources older than a
+        # couple (6) of hours
+        resource_groups = resource_client.resource_groups.list()
+        now_ts = int(time.time())
+        delete_threshold_ts = now_ts - (6 * 60 * 60)

Review comment:
       Nit: this may be easier to read using `from datetime import timedelta; timedelta(hours=60).total_seconds()`




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@libcloud.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [libcloud] Kami merged pull request #1617: Clean up old / stray Azure resources before the test run, speed up tests

Posted by GitBox <gi...@apache.org>.
Kami merged pull request #1617:
URL: https://github.com/apache/libcloud/pull/1617


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@libcloud.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [libcloud] Kami commented on a change in pull request #1617: Clean up old / stray resources before the test run

Posted by GitBox <gi...@apache.org>.
Kami commented on a change in pull request #1617:
URL: https://github.com/apache/libcloud/pull/1617#discussion_r734829210



##########
File path: integration/storage/test_azure_blobs.py
##########
@@ -124,17 +128,46 @@ def setUpClass(cls):
         )
 
         location = os.getenv('AZURE_LOCATION', DEFAULT_AZURE_LOCATION)
-        name = 'libcloud'
+        name = RESOURCE_GROUP_NAME_PREFIX
         name += random_string(MAX_STORAGE_ACCOUNT_NAME_LENGTH - len(name))
         timeout = float(os.getenv('AZURE_TIMEOUT_SECONDS', DEFAULT_TIMEOUT_SECONDS))
 
+        # We clean up any left over resource groups from previous runs on setUpClass. If tests on
+        # CI get terminated non-gracefully, old resources will be left laying around and we want
+        # to clean those up to ensure we dont hit any limits.
+        # To avoid deleting groups from concurrent runs, we only delete resources older than a
+        # couple (6) of hours
+        print("Checking and cleaning up any old stray resource groups...")
+
+        resource_groups = resource_client.resource_groups.list()
+        now_ts = int(time.time())
+        delete_threshold_ts = now_ts - int(datetime.timedelta(hours=6).total_seconds())
+
+        for resource_group in resource_groups:
+            resource_create_ts = resource_group.tags.get('create_ts', now_ts)
+
+            if resource_group.name.startswith(RESOURCE_GROUP_NAME_PREFIX) and \
+               resource_group.location.lower() == location.lower() and \
+               'test' in resource_group.tags and resource_create_ts <= delete_threshold_ts:
+                assert resource_group.name.startswith(RESOURCE_GROUP_NAME_PREFIX)

Review comment:
       It's jut an additional safe guard in case there was a fat finger in if or similar which could potentially result in objects with a different prefix to be deleted (granted, it's probably an over kill since we have additional checks and right now that account is only used for those tests).




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@libcloud.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [libcloud] codecov-commenter edited a comment on pull request #1617: Clean up old / stray resources before the test run

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1617:
URL: https://github.com/apache/libcloud/pull/1617#issuecomment-949853125


   # [Codecov](https://codecov.io/gh/apache/libcloud/pull/1617?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#1617](https://codecov.io/gh/apache/libcloud/pull/1617?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (bbcaa27) into [trunk](https://codecov.io/gh/apache/libcloud/commit/24ef735ac327e8f6276d5b8883a4d367462733ac?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (24ef735) will **not change** coverage.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/libcloud/pull/1617/graphs/tree.svg?width=650&height=150&src=pr&token=PYoduksh69&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/libcloud/pull/1617?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@           Coverage Diff           @@
   ##            trunk    #1617   +/-   ##
   =======================================
     Coverage   83.02%   83.02%           
   =======================================
     Files         394      394           
     Lines       85269    85269           
     Branches     9070     9070           
   =======================================
     Hits        70795    70795           
     Misses      11390    11390           
     Partials     3084     3084           
   ```
   
   
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/libcloud/pull/1617?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/libcloud/pull/1617?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [24ef735...bbcaa27](https://codecov.io/gh/apache/libcloud/pull/1617?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@libcloud.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [libcloud] codecov-commenter commented on pull request #1617: Clean up old / stray resources before the test run

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on pull request #1617:
URL: https://github.com/apache/libcloud/pull/1617#issuecomment-949853125


   # [Codecov](https://codecov.io/gh/apache/libcloud/pull/1617?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#1617](https://codecov.io/gh/apache/libcloud/pull/1617?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (fcc0d72) into [trunk](https://codecov.io/gh/apache/libcloud/commit/24ef735ac327e8f6276d5b8883a4d367462733ac?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (24ef735) will **increase** coverage by `0.00%`.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/libcloud/pull/1617/graphs/tree.svg?width=650&height=150&src=pr&token=PYoduksh69&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/libcloud/pull/1617?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@           Coverage Diff           @@
   ##            trunk    #1617   +/-   ##
   =======================================
     Coverage   83.02%   83.02%           
   =======================================
     Files         394      394           
     Lines       85269    85269           
     Branches     9070     9070           
   =======================================
   + Hits        70795    70797    +2     
   + Misses      11390    11389    -1     
   + Partials     3084     3083    -1     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/libcloud/pull/1617?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [libcloud/test/dns/test\_base.py](https://codecov.io/gh/apache/libcloud/pull/1617/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-bGliY2xvdWQvdGVzdC9kbnMvdGVzdF9iYXNlLnB5) | `100.00% <0.00%> (+2.98%)` | :arrow_up: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/libcloud/pull/1617?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/libcloud/pull/1617?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [24ef735...fcc0d72](https://codecov.io/gh/apache/libcloud/pull/1617?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@libcloud.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [libcloud] c-w commented on a change in pull request #1617: Clean up old / stray resources before the test run

Posted by GitBox <gi...@apache.org>.
c-w commented on a change in pull request #1617:
URL: https://github.com/apache/libcloud/pull/1617#discussion_r734827643



##########
File path: integration/storage/test_azure_blobs.py
##########
@@ -124,17 +128,46 @@ def setUpClass(cls):
         )
 
         location = os.getenv('AZURE_LOCATION', DEFAULT_AZURE_LOCATION)
-        name = 'libcloud'
+        name = RESOURCE_GROUP_NAME_PREFIX
         name += random_string(MAX_STORAGE_ACCOUNT_NAME_LENGTH - len(name))
         timeout = float(os.getenv('AZURE_TIMEOUT_SECONDS', DEFAULT_TIMEOUT_SECONDS))
 
+        # We clean up any left over resource groups from previous runs on setUpClass. If tests on
+        # CI get terminated non-gracefully, old resources will be left laying around and we want
+        # to clean those up to ensure we dont hit any limits.
+        # To avoid deleting groups from concurrent runs, we only delete resources older than a
+        # couple (6) of hours
+        print("Checking and cleaning up any old stray resource groups...")
+
+        resource_groups = resource_client.resource_groups.list()
+        now_ts = int(time.time())
+        delete_threshold_ts = now_ts - int(datetime.timedelta(hours=6).total_seconds())
+
+        for resource_group in resource_groups:
+            resource_create_ts = resource_group.tags.get('create_ts', now_ts)
+
+            if resource_group.name.startswith(RESOURCE_GROUP_NAME_PREFIX) and \
+               resource_group.location.lower() == location.lower() and \
+               'test' in resource_group.tags and resource_create_ts <= delete_threshold_ts:
+                assert resource_group.name.startswith(RESOURCE_GROUP_NAME_PREFIX)

Review comment:
       Is this necessary given that we have the check on line 149 which means that this assert should always pass?




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@libcloud.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [libcloud] Kami commented on pull request #1617: Clean up old / stray resources before the test run

Posted by GitBox <gi...@apache.org>.
Kami commented on pull request #1617:
URL: https://github.com/apache/libcloud/pull/1617#issuecomment-949953283


   https://github.com/apache/libcloud/runs/3980290729?check_suite_focus=true
   
   Looks like the integration tests run with that change now takes ~1 minute instead of ~8 minutes.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@libcloud.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [libcloud] codecov-commenter edited a comment on pull request #1617: Clean up old / stray resources before the test run

Posted by GitBox <gi...@apache.org>.
codecov-commenter edited a comment on pull request #1617:
URL: https://github.com/apache/libcloud/pull/1617#issuecomment-949853125


   # [Codecov](https://codecov.io/gh/apache/libcloud/pull/1617?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#1617](https://codecov.io/gh/apache/libcloud/pull/1617?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (784b67c) into [trunk](https://codecov.io/gh/apache/libcloud/commit/24ef735ac327e8f6276d5b8883a4d367462733ac?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (24ef735) will **not change** coverage.
   > The diff coverage is `n/a`.
   
   [![Impacted file tree graph](https://codecov.io/gh/apache/libcloud/pull/1617/graphs/tree.svg?width=650&height=150&src=pr&token=PYoduksh69&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/libcloud/pull/1617?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@           Coverage Diff           @@
   ##            trunk    #1617   +/-   ##
   =======================================
     Coverage   83.02%   83.02%           
   =======================================
     Files         394      394           
     Lines       85269    85269           
     Branches     9070     9070           
   =======================================
     Hits        70795    70795           
     Misses      11390    11390           
     Partials     3084     3084           
   ```
   
   
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/libcloud/pull/1617?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/libcloud/pull/1617?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [24ef735...784b67c](https://codecov.io/gh/apache/libcloud/pull/1617?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@libcloud.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org