Repository navigation
test: fix broken and flaky CI Health V2 integ tests - #6386
Merged
lucasjia-aws merged 1 commit intoOct 6, 2026
Merged
Conversation
- sagemaker_config: ignore service-side defaults (MetricsConfig, VolumeSizeInGB) that the SDK never sets - serve: stop deleting every endpoint in the shared account before and after each ModelBuilder deploy test; clean up only the test's own endpoint, endpoint config and model - lineage: recreate the static endpoint from its surviving endpoint config instead of silently continuing without an endpoint - deployment steps: page through list_* results, since NameContains is applied per page and the run's resources can fall off page one - inference recommender: make retry_and_back_off actually retry throttled right_size() calls, and stop fixtures from swallowing errors - mark gated JumpStart and HF g5 tests as xfail on insufficient capacity
mohamedzeidan2021
approved these changes
Oct 6, 2026
lucasjia-aws
temporarily deployed
to
auto-approve
October 6, 2026 23:40 — with
GitHub Actions
Inactive
This branch was previously deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The scheduled CI Health V2 workflow (slow-tests-v2 and canaries-v2-master, run against master-v2) has been red every day for weeks. Example run: https://github.com/aws/sagemaker-python-sdk/actions/runs/37412457307. This PR fixes the test-side causes; no SDK source changes.
Root causes and fixes
test_sagemaker_config_cross_context_injection (fails every run): DescribeEndpoint/DescribeEndpointConfig now return
MetricsConfig: {EnableDetailedObservability: True}by default, and the defaultVolumeSizeInGBfor ml.c5.xlarge changed from 4 to 8. Neither is set by the SDK or the sagemaker_config, so the test now drops them before comparing.lineage test_context.py::test_action (ERROR every run since 2026-09-28): The autouse
cleanup_endpointsfixture intests/integ/sagemaker/serve/test_base_model_builder_deploy.pydeleted every endpoint on the first ListEndpoints page of the shared account before and after each test. On 2026-09-28 it deleted the lineage static endpointSdkIntegTestStaticEndpoint20(confirmed in CloudTrail), along with endpoints other running tests were using. ListEndpoints does not returnEndpointConfigName, so the endpoint config was left behind; the lineage fixture's redeploy then failed on CreateEndpointConfig, the ValidationException was swallowed as "already exists", and the test ended inlist_contexts(SourceUri=None). The sweep is replaced by per-test cleanup of only the resources each test creates, and the lineage fixture now recreates the endpoint from the surviving config and fails with a clear message if it still cannot.test_deployment_steps_execute_end_to_end (flaky): SageMaker applies
NameContainsper result page, so a single unpaginatedlist_endpoint_configs(NameContains=stamp)returns an empty page once more than 10 newer configs exist, which is routine while the canary runs 120 workers in the same account. The same unpaginated calls in cleanup also leaked the test's endpoint. Lookups and cleanup now page through results, withCreationTimeAfterand page size 100 to keep paging cheap.test_advanced_right_size_and_deploy_unregistered_model_sklearn: CreateInferenceRecommendationsJob was throttled when several module fixtures started IR jobs at once.
retry_and_back_offreceived the already-evaluatedright_size()result, so it never retried, and the fixture swallowed the exception and returnedNone, so the test reported AttributeError/UnboundLocalError instead. The helper now takes a callable, retries throttling with jittered back-off (deleting the modelright_size()pre-created before retrying), fixtures re-raise after cleanup, and tests guardpredictorinfinally.Insufficient capacity:
test_jumpstart_gated_model(ml.g6e.xlarge), the private hub gated model/estimator tests (ml.g5.2xlarge) andtest_huggingface_torch_distributed_g5_glue(ml.g5.4xlarge) fail on InsufficientInstanceCapacity or wait for capacity until timeout. They now use the existingx_fail_if_ice(andfit_estimator_with_capacity_xfailfor the HF training job), matching how sibling tests already handle capacity.Testing
black (24.3.0) and flake8 (7.1.2) pass on all changed files, and
pytest --collect-onlycollects all affected integ modules. Offline mock checks covered the retry helper, the paginated lookups (parameters validated with botocore Stubber), the scoped endpoint cleanup, and all lineage endpoint recovery paths. The integ tests themselves were not run locally because they need the CI account; they will be exercised by the next CI Health V2 run.