Skip to content

Commit

Permalink
[ACR] Extend weekly pipeline timeout (Azure#31684)
Browse files Browse the repository at this point in the history
  • Loading branch information
YalinLi0312 authored Aug 17, 2023
1 parent 3ea9d5c commit 36a82f3
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineRequest
from azure.identity import AzureAuthorityHosts
from testcase import ContainerRegistryTestClass, get_authority, get_audience, is_public_endpoint
from testcase import ContainerRegistryTestClass, get_authority, get_audience, is_public_endpoint, is_china_endpoint
from constants import HELLO_WORLD, DOES_NOT_EXIST
from preparer import acr_preparer
from devtools_testutils import recorded_by_proxy
Expand Down Expand Up @@ -636,10 +636,8 @@ def test_upload_blob(self, containerregistry_endpoint):
@acr_preparer()
def upload_large_blob_in_chunk(self, **kwargs):
containerregistry_endpoint = kwargs.pop("containerregistry_endpoint")
if not is_public_endpoint(containerregistry_endpoint):
pytest.skip(
"Running on non-public cloud may cause all tests finishing longer than the max time of 120 mins."
)
if is_china_endpoint(containerregistry_endpoint):
pytest.skip("Running on China cloud usually will fail due to timeout.")

repo = self.get_resource_name("repo")
with self.create_registry_client(containerregistry_endpoint) as client:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
from azure.core.pipeline import PipelineRequest
from azure.identity import AzureAuthorityHosts
from asynctestcase import AsyncContainerRegistryTestClass, get_authority, get_audience
from testcase import is_public_endpoint
from testcase import is_public_endpoint, is_china_endpoint
from constants import HELLO_WORLD, DOES_NOT_EXIST
from preparer import acr_preparer
from devtools_testutils.aio import recorded_by_proxy_async
Expand Down Expand Up @@ -640,10 +640,8 @@ async def test_upload_blob(self, containerregistry_endpoint):
@acr_preparer()
async def test_upload_large_blob_in_chunk(self, **kwargs):
containerregistry_endpoint = kwargs.pop("containerregistry_endpoint")
if not is_public_endpoint(containerregistry_endpoint):
pytest.skip(
"Running on non-public cloud may cause all tests finishing longer than the max time of 120 mins."
)
if is_china_endpoint(containerregistry_endpoint):
pytest.skip("Running on China cloud usually will fail due to timeout.")

repo = self.get_resource_name("repo")
async with self.create_registry_client(containerregistry_endpoint) as client:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,10 @@ def is_public_endpoint(endpoint):
return ".azurecr.io" in endpoint


def is_china_endpoint(endpoint):
return ".azurecr.cn" in endpoint


def get_authority(endpoint: str) -> str:
if ".azurecr.io" in endpoint:
logger.warning("Public cloud Authority")
Expand Down
1 change: 1 addition & 0 deletions sdk/containerregistry/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ stages:
BuildTargetingString: azure-containerregistry
ServiceDirectory: containerregistry
SupportedClouds: 'Public,UsGov,China'
TestTimeoutInMinutes: 240
CloudConfig:
Public:
SubscriptionConfiguration: $(sub-config-azure-cloud-test-resources)
Expand Down

0 comments on commit 36a82f3

Please sign in to comment.