Skip to content

Reducing test flakiness #601

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 6 commits into from
Jan 17, 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: 16 additions & 0 deletions tests/integ/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,25 @@
# ANY KIND, either express or implied. See the License for the specific
# language governing permissions and limitations under the License.
from __future__ import absolute_import

import os

import pytest


def create_sagemaker_local_network():
"""
Docker has a known race condition which allows two parallel processes
to create a duplicated networks with the same name. This function
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/to create a duplicated/to create duplicated

creates the network sagemaker-local beforehand, avoiding this issue
in CI.
"""
os.system('docker network create sagemaker-local')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

how is this 'if necessary' ?
shouldnt this method be renamed to create_sagemaker_local_network() ?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point. Done.



create_sagemaker_local_network()


@pytest.fixture(scope='session', params=['local', 'ml.c4.xlarge'])
def instance_type(request):
return request.param
2 changes: 2 additions & 0 deletions tests/integ/test_tf.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ def tf_training_job(sagemaker_session, tf_full_version):
framework_version=tf_full_version,
training_steps=1,
evaluation_steps=1,
checkpoint_path='/opt/ml/model',
hyperparameters={'input_tensor_name': 'inputs'},
train_instance_count=1,
train_instance_type='ml.c4.xlarge',
Expand Down Expand Up @@ -114,6 +115,7 @@ def test_tf_async(sagemaker_session):
role='SageMakerRole',
training_steps=1,
evaluation_steps=1,
checkpoint_path='/opt/ml/model',
hyperparameters={'input_tensor_name': 'inputs'},
train_instance_count=1,
train_instance_type='ml.c4.xlarge',
Expand Down