diff --git a/tests/data/chainer_mnist/failure_script.py b/tests/data/chainer_mnist/failure_script.py deleted file mode 100644 index b19dd46c01..0000000000 --- a/tests/data/chainer_mnist/failure_script.py +++ /dev/null @@ -1,16 +0,0 @@ -# Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"). You -# may not use this file except in compliance with the License. A copy of -# the License is located at -# -# http://aws.amazon.com/apache2.0/ -# -# or in the "license" file accompanying this file. This file is -# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF -# ANY KIND, either express or implied. See the License for the specific -# language governing permissions and limitations under the License. - -if __name__ == "__main__": - """For use with integration tests expecting failures.""" - raise Exception("This failure is expected.") diff --git a/tests/data/pytorch_mnist/failure_script.py b/tests/data/pytorch_mnist/failure_script.py deleted file mode 100644 index 4b9abfbd16..0000000000 --- a/tests/data/pytorch_mnist/failure_script.py +++ /dev/null @@ -1,3 +0,0 @@ -if __name__ == "__main__": - """For use with integration tests expecting failures.""" - raise Exception("This failure is expected.") diff --git a/tests/integ/test_chainer_train.py b/tests/integ/test_chainer_train.py index ebfee9469c..a3840c8aca 100644 --- a/tests/integ/test_chainer_train.py +++ b/tests/integ/test_chainer_train.py @@ -125,25 +125,6 @@ def test_async_fit(sagemaker_session): _predict_and_assert(predictor) -def test_failed_training_job(sagemaker_session, chainer_full_version): - with timeout(minutes=TRAINING_DEFAULT_TIMEOUT_MINUTES): - script_path = os.path.join(DATA_DIR, "chainer_mnist", "failure_script.py") - - chainer = Chainer( - entry_point=script_path, - role="SageMakerRole", - framework_version=chainer_full_version, - py_version=PYTHON_VERSION, - train_instance_count=1, - train_instance_type="ml.c4.xlarge", - sagemaker_session=sagemaker_session, - ) - - with pytest.raises(ValueError) as e: - chainer.fit(job_name=unique_name_from_base("test-chainer-training")) - assert "ExecuteUserScriptError" in str(e.value) - - def _run_mnist_training_job( sagemaker_session, instance_type, instance_count, chainer_full_version, wait=True ): diff --git a/tests/integ/test_mxnet_train.py b/tests/integ/test_mxnet_train.py index e4f1a96983..a4965b33e8 100644 --- a/tests/integ/test_mxnet_train.py +++ b/tests/integ/test_mxnet_train.py @@ -286,22 +286,3 @@ def test_async_fit(sagemaker_session, mxnet_full_version): data = numpy.zeros(shape=(1, 1, 28, 28)) result = predictor.predict(data) assert result is not None - - -def test_failed_training_job(sagemaker_session, mxnet_full_version): - with timeout(): - script_path = os.path.join(DATA_DIR, "mxnet_mnist", "failure_script.py") - - mx = MXNet( - entry_point=script_path, - role="SageMakerRole", - framework_version=mxnet_full_version, - py_version=PYTHON_VERSION, - train_instance_count=1, - train_instance_type="ml.c4.xlarge", - sagemaker_session=sagemaker_session, - ) - - with pytest.raises(ValueError) as e: - mx.fit() - assert "ExecuteUserScriptError" in str(e.value) diff --git a/tests/integ/test_pytorch_train.py b/tests/integ/test_pytorch_train.py index 4f9467d420..f21450ceed 100644 --- a/tests/integ/test_pytorch_train.py +++ b/tests/integ/test_pytorch_train.py @@ -116,20 +116,6 @@ def test_async_fit_deploy(sagemaker_session, pytorch_full_version): assert output.shape == (batch_size, 10) -# TODO(nadiaya): Run against local mode when errors will be propagated -def test_failed_training_job(sagemaker_session, pytorch_full_version): - script_path = os.path.join(MNIST_DIR, "failure_script.py") - - with timeout(minutes=TRAINING_DEFAULT_TIMEOUT_MINUTES): - pytorch = _get_pytorch_estimator( - sagemaker_session, pytorch_full_version, entry_point=script_path - ) - - with pytest.raises(ValueError) as e: - pytorch.fit() - assert "ExecuteUserScriptError" in str(e.value) - - def _upload_training_data(pytorch): return pytorch.sagemaker_session.upload_data( path=os.path.join(MNIST_DIR, "training"),