|
20 | 20 | import pytest
|
21 | 21 | import tempfile
|
22 | 22 |
|
| 23 | +import stopit |
| 24 | + |
23 | 25 | import tests.integ.lock as lock
|
24 | 26 | from tests.integ import DATA_DIR, PYTHON_VERSION
|
25 |
| -from tests.integ.timeout import timeout |
26 | 27 |
|
27 | 28 | from sagemaker.local import LocalSession, LocalSagemakerRuntimeClient, LocalSagemakerClient
|
28 | 29 | from sagemaker.mxnet import MXNet
|
@@ -86,7 +87,7 @@ def _create_model(output_path):
|
86 | 87 | @pytest.mark.local_mode
|
87 | 88 | @pytest.mark.skipif(PYTHON_VERSION != "py2", reason="TensorFlow image supports only python 2.")
|
88 | 89 | def test_tf_local_mode(sagemaker_local_session):
|
89 |
| - with timeout(minutes=5): |
| 90 | + with stopit.ThreadingTimeout(5 * 60, swallow_exc=False): |
90 | 91 | script_path = os.path.join(DATA_DIR, "iris", "iris-dnn-classifier.py")
|
91 | 92 |
|
92 | 93 | estimator = TensorFlow(
|
@@ -129,7 +130,7 @@ def test_tf_local_mode(sagemaker_local_session):
|
129 | 130 | @pytest.mark.local_mode
|
130 | 131 | @pytest.mark.skipif(PYTHON_VERSION != "py2", reason="TensorFlow image supports only python 2.")
|
131 | 132 | def test_tf_distributed_local_mode(sagemaker_local_session):
|
132 |
| - with timeout(minutes=5): |
| 133 | + with stopit.ThreadingTimeout(5 * 60, swallow_exc=False): |
133 | 134 | script_path = os.path.join(DATA_DIR, "iris", "iris-dnn-classifier.py")
|
134 | 135 |
|
135 | 136 | estimator = TensorFlow(
|
@@ -171,7 +172,7 @@ def test_tf_distributed_local_mode(sagemaker_local_session):
|
171 | 172 | @pytest.mark.local_mode
|
172 | 173 | @pytest.mark.skipif(PYTHON_VERSION != "py2", reason="TensorFlow image supports only python 2.")
|
173 | 174 | def test_tf_local_data(sagemaker_local_session):
|
174 |
| - with timeout(minutes=5): |
| 175 | + with stopit.ThreadingTimeout(5 * 60, swallow_exc=False): |
175 | 176 | script_path = os.path.join(DATA_DIR, "iris", "iris-dnn-classifier.py")
|
176 | 177 |
|
177 | 178 | estimator = TensorFlow(
|
@@ -212,7 +213,7 @@ def test_tf_local_data(sagemaker_local_session):
|
212 | 213 | @pytest.mark.local_mode
|
213 | 214 | @pytest.mark.skipif(PYTHON_VERSION != "py2", reason="TensorFlow image supports only python 2.")
|
214 | 215 | def test_tf_local_data_local_script():
|
215 |
| - with timeout(minutes=5): |
| 216 | + with stopit.ThreadingTimeout(5 * 60, swallow_exc=False): |
216 | 217 | script_path = os.path.join(DATA_DIR, "iris", "iris-dnn-classifier.py")
|
217 | 218 |
|
218 | 219 | estimator = TensorFlow(
|
@@ -391,7 +392,7 @@ def test_local_transform_mxnet(sagemaker_local_session, tmpdir, mxnet_full_versi
|
391 | 392 | path=os.path.join(data_path, "test"), key_prefix="integ-test-data/mxnet_mnist/test"
|
392 | 393 | )
|
393 | 394 |
|
394 |
| - with timeout(minutes=15): |
| 395 | + with stopit.ThreadingTimeout(5 * 60, swallow_exc=False): |
395 | 396 | mx.fit({"train": train_input, "test": test_input})
|
396 | 397 |
|
397 | 398 | transform_input_path = os.path.join(data_path, "transform")
|
|
0 commit comments