Skip to content

fix: remove unnecessary failure case tests #892

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 28, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 0 additions & 16 deletions tests/data/chainer_mnist/failure_script.py

This file was deleted.

3 changes: 0 additions & 3 deletions tests/data/pytorch_mnist/failure_script.py

This file was deleted.

19 changes: 0 additions & 19 deletions tests/integ/test_chainer_train.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
):
Expand Down
19 changes: 0 additions & 19 deletions tests/integ/test_mxnet_train.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
14 changes: 0 additions & 14 deletions tests/integ/test_pytorch_train.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"),
Expand Down