Skip to content

Commit 8be1f38

Browse files
authored
chore: add flaky test markers & skip region with low P3 instance capacity (#4870)
* chore: add flaky test markers * skip p2 instance tests in eu-west-1 * Fix to check p3
1 parent 653f3b5 commit 8be1f38

File tree

5 files changed

+16
-0
lines changed

5 files changed

+16
-0
lines changed

tests/integ/__init__.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@
8787
"ap-south-1",
8888
"ap-northeast-2", # it has p3, but not enough
8989
"us-east-2", # it has p3, but not enough
90+
"eu-west-1", # it has p3, but not enough
9091
]
9192

9293
# EI is currently only supported in the following regions

tests/integ/test_huggingface.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@
2929

3030

3131
@pytest.mark.release
32+
@pytest.mark.skipif(
33+
tests.integ.test_region() in tests.integ.TRAINING_NO_P3_REGIONS,
34+
reason="No P3 instances or low capacity in this region",
35+
)
3236
def test_framework_processing_job_with_deps(
3337
sagemaker_session,
3438
huggingface_training_latest_version,
@@ -59,6 +63,10 @@ def test_framework_processing_job_with_deps(
5963

6064

6165
@pytest.mark.release
66+
@pytest.mark.skipif(
67+
tests.integ.test_region() in tests.integ.TRAINING_NO_P3_REGIONS,
68+
reason="No P3 instances or low capacity in this region",
69+
)
6270
def test_huggingface_training(
6371
sagemaker_session,
6472
huggingface_training_latest_version,

tests/integ/test_training_compiler.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,10 @@ def skip_if_incompatible(gpu_instance_type, request):
9090
pytest.param("ml.p3.16xlarge", 2),
9191
],
9292
)
93+
@pytest.mark.skipif(
94+
integ.test_region() in integ.TRAINING_NO_P3_REGIONS,
95+
reason="No P3 instances or low capacity in this region",
96+
)
9397
def test_huggingface_pytorch(
9498
sagemaker_session,
9599
gpu_instance_type,

tests/unit/sagemaker/jumpstart/test_notebook_utils.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@ def test_list_jumpstart_models_simple_case(
231231

232232
@patch("sagemaker.jumpstart.accessors.JumpStartModelsAccessor._get_manifest")
233233
@patch("sagemaker.jumpstart.notebook_utils.DEFAULT_JUMPSTART_SAGEMAKER_SESSION.read_s3_file")
234+
@pytest.mark.flaky(reruns=5, reruns_delay=1)
234235
def test_list_jumpstart_models_script_filter(
235236
self, patched_read_s3_file: Mock, patched_get_manifest: Mock
236237
):
@@ -583,6 +584,7 @@ def vulnerable_training_model_spec(bucket, key, *args, **kwargs):
583584

584585
@patch("sagemaker.jumpstart.accessors.JumpStartModelsAccessor._get_manifest")
585586
@patch("sagemaker.jumpstart.notebook_utils.DEFAULT_JUMPSTART_SAGEMAKER_SESSION.read_s3_file")
587+
@pytest.mark.flaky(reruns=5, reruns_delay=1)
586588
def test_list_jumpstart_models_deprecated_models(
587589
self,
588590
patched_read_s3_file: Mock,

tests/unit/sagemaker/workflow/test_transform_step.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
custom_step.properties.OutputDataConfig.S3OutputPath,
7171
],
7272
)
73+
@pytest.mark.flaky(reruns=5, reruns_delay=1)
7374
def test_transform_step_with_transformer(model_name, data, output_path, pipeline_session):
7475
transformer = Transformer(
7576
model_name=model_name,

0 commit comments

Comments
 (0)