Skip to content

Commit 3cc6cce

Browse files
authored
Reducing test flakiness (#601)
1 parent 84a849f commit 3cc6cce

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

tests/integ/conftest.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,25 @@
1111
# ANY KIND, either express or implied. See the License for the specific
1212
# language governing permissions and limitations under the License.
1313
from __future__ import absolute_import
14+
15+
import os
16+
1417
import pytest
1518

1619

20+
def create_sagemaker_local_network():
21+
"""
22+
Docker has a known race condition which allows two parallel processes
23+
to create a duplicated networks with the same name. This function
24+
creates the network sagemaker-local beforehand, avoiding this issue
25+
in CI.
26+
"""
27+
os.system('docker network create sagemaker-local')
28+
29+
30+
create_sagemaker_local_network()
31+
32+
1733
@pytest.fixture(scope='session', params=['local', 'ml.c4.xlarge'])
1834
def instance_type(request):
1935
return request.param

tests/integ/test_tf.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ def tf_training_job(sagemaker_session, tf_full_version):
3838
framework_version=tf_full_version,
3939
training_steps=1,
4040
evaluation_steps=1,
41+
checkpoint_path='/opt/ml/model',
4142
hyperparameters={'input_tensor_name': 'inputs'},
4243
train_instance_count=1,
4344
train_instance_type='ml.c4.xlarge',
@@ -114,6 +115,7 @@ def test_tf_async(sagemaker_session):
114115
role='SageMakerRole',
115116
training_steps=1,
116117
evaluation_steps=1,
118+
checkpoint_path='/opt/ml/model',
117119
hyperparameters={'input_tensor_name': 'inputs'},
118120
train_instance_count=1,
119121
train_instance_type='ml.c4.xlarge',

0 commit comments

Comments
 (0)