Skip to content

Commit 670ed8c

Browse files
authored
test(feature-processor): Isolate pipeline names to fix flaky integ tests (#6095)
The feature processor to_pipeline integ tests hardcoded fixed pipeline names (pipeline-name-01, pipeline-name-lf-01) and thus shared fixed S3 paths (s3://.../<pipeline_name>/function/payload.pkl). Combined with the asymmetric-signing scheme introduced in PR #5816 (each to_pipeline call generates a fresh ECDSA key pair, overwrites the signed payload, and pins the matching public key into the pipeline env), concurrent CI builds on the same account overwrite each other's payloads. A running execution then verifies a payload signed by a different build's key, producing DeserializationError: "Integrity check for the serialized function or data failed" and pipeline execution status Failed. Generate unique pipeline names via unique_name_from_base so each test run and build uses an isolated S3 prefix, and restore cleanup_pipeline in the finally blocks to avoid resource leakage.
1 parent 1a22381 commit 670ed8c

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

‎sagemaker-mlops/tests/integ/feature_store/feature_processor/test_feature_processor_integ.py‎

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333

3434
from tests.integ import DATA_DIR
3535
from sagemaker.core.helper.session_helper import Session, get_execution_role
36+
from sagemaker.core.common_utils import unique_name_from_base
3637
from sagemaker.core.s3 import S3Uploader
3738
from urllib.parse import urlparse
3839
from sagemaker.core.remote_function import remote
@@ -681,7 +682,7 @@ def test_to_pipeline_and_execute(
681682
pre_execution_commands,
682683
dependencies_path,
683684
):
684-
pipeline_name = "pipeline-name-01"
685+
pipeline_name = unique_name_from_base("pipeline-name-01")
685686
car_data_feature_group_name = get_car_data_feature_group_name()
686687
car_data_aggregated_feature_group_name = get_car_data_aggregated_feature_group_name()
687688
try:
@@ -791,7 +792,7 @@ def transform(raw_s3_data_as_df):
791792
cleanup_feature_group(
792793
feature_groups["car_data_aggregated_feature_group"], sagemaker_session=sagemaker_session
793794
)
794-
# cleanup_pipeline(pipeline_name="pipeline-name-01", sagemaker_session=sagemaker_session)
795+
cleanup_pipeline(pipeline_name=pipeline_name, sagemaker_session=sagemaker_session)
795796

796797

797798
# @pytest.mark.skipif(
@@ -810,7 +811,7 @@ def test_to_pipeline_and_execute_with_lake_formation(
810811
pre_execution_commands,
811812
dependencies_path,
812813
):
813-
pipeline_name = "pipeline-name-lf-01"
814+
pipeline_name = unique_name_from_base("pipeline-name-lf-01")
814815
car_data_feature_group_name = get_car_data_feature_group_name()
815816
car_data_fg = None
816817
try:
@@ -946,6 +947,7 @@ def transform(raw_s3_data_as_df):
946947
except Exception as e:
947948
logging.warning(f"Failed to delete Glue table: {e}")
948949
cleanup_feature_group(car_data_fg, sagemaker_session=sagemaker_session)
950+
cleanup_pipeline(pipeline_name=pipeline_name, sagemaker_session=sagemaker_session)
949951

950952

951953
# @pytest.mark.skipif(
@@ -959,7 +961,7 @@ def test_schedule_and_event_trigger(
959961
pre_execution_commands,
960962
dependencies_path,
961963
):
962-
pipeline_name = "pipeline-name-01"
964+
pipeline_name = unique_name_from_base("pipeline-name-01")
963965
car_data_feature_group_name = get_car_data_feature_group_name()
964966
car_data_aggregated_feature_group_name = get_car_data_aggregated_feature_group_name()
965967
try:
@@ -1175,6 +1177,7 @@ def transform(raw_s3_data_as_df):
11751177
cleanup_feature_group(
11761178
feature_groups["car_data_aggregated_feature_group"], sagemaker_session=sagemaker_session
11771179
)
1180+
cleanup_pipeline(pipeline_name=pipeline_name, sagemaker_session=sagemaker_session)
11781181

11791182

11801183
def get_car_data_feature_group_name():

0 commit comments

Comments
 (0)