Skip to content

Commit 8a95d68

Browse files
authored
fix: remove unnecessary failure case tests (#892)
1 parent fe29f60 commit 8a95d68

File tree

5 files changed

+0
-71
lines changed

5 files changed

+0
-71
lines changed

tests/data/chainer_mnist/failure_script.py

-16
This file was deleted.

tests/data/pytorch_mnist/failure_script.py

-3
This file was deleted.

tests/integ/test_chainer_train.py

-19
Original file line numberDiff line numberDiff line change
@@ -125,25 +125,6 @@ def test_async_fit(sagemaker_session):
125125
_predict_and_assert(predictor)
126126

127127

128-
def test_failed_training_job(sagemaker_session, chainer_full_version):
129-
with timeout(minutes=TRAINING_DEFAULT_TIMEOUT_MINUTES):
130-
script_path = os.path.join(DATA_DIR, "chainer_mnist", "failure_script.py")
131-
132-
chainer = Chainer(
133-
entry_point=script_path,
134-
role="SageMakerRole",
135-
framework_version=chainer_full_version,
136-
py_version=PYTHON_VERSION,
137-
train_instance_count=1,
138-
train_instance_type="ml.c4.xlarge",
139-
sagemaker_session=sagemaker_session,
140-
)
141-
142-
with pytest.raises(ValueError) as e:
143-
chainer.fit(job_name=unique_name_from_base("test-chainer-training"))
144-
assert "ExecuteUserScriptError" in str(e.value)
145-
146-
147128
def _run_mnist_training_job(
148129
sagemaker_session, instance_type, instance_count, chainer_full_version, wait=True
149130
):

tests/integ/test_mxnet_train.py

-19
Original file line numberDiff line numberDiff line change
@@ -286,22 +286,3 @@ def test_async_fit(sagemaker_session, mxnet_full_version):
286286
data = numpy.zeros(shape=(1, 1, 28, 28))
287287
result = predictor.predict(data)
288288
assert result is not None
289-
290-
291-
def test_failed_training_job(sagemaker_session, mxnet_full_version):
292-
with timeout():
293-
script_path = os.path.join(DATA_DIR, "mxnet_mnist", "failure_script.py")
294-
295-
mx = MXNet(
296-
entry_point=script_path,
297-
role="SageMakerRole",
298-
framework_version=mxnet_full_version,
299-
py_version=PYTHON_VERSION,
300-
train_instance_count=1,
301-
train_instance_type="ml.c4.xlarge",
302-
sagemaker_session=sagemaker_session,
303-
)
304-
305-
with pytest.raises(ValueError) as e:
306-
mx.fit()
307-
assert "ExecuteUserScriptError" in str(e.value)

tests/integ/test_pytorch_train.py

-14
Original file line numberDiff line numberDiff line change
@@ -116,20 +116,6 @@ def test_async_fit_deploy(sagemaker_session, pytorch_full_version):
116116
assert output.shape == (batch_size, 10)
117117

118118

119-
# TODO(nadiaya): Run against local mode when errors will be propagated
120-
def test_failed_training_job(sagemaker_session, pytorch_full_version):
121-
script_path = os.path.join(MNIST_DIR, "failure_script.py")
122-
123-
with timeout(minutes=TRAINING_DEFAULT_TIMEOUT_MINUTES):
124-
pytorch = _get_pytorch_estimator(
125-
sagemaker_session, pytorch_full_version, entry_point=script_path
126-
)
127-
128-
with pytest.raises(ValueError) as e:
129-
pytorch.fit()
130-
assert "ExecuteUserScriptError" in str(e.value)
131-
132-
133119
def _upload_training_data(pytorch):
134120
return pytorch.sagemaker_session.upload_data(
135121
path=os.path.join(MNIST_DIR, "training"),

0 commit comments

Comments
 (0)