Skip to content

Use sagemaker_timestamp in endpoint names in integration tests. #81

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 2 commits into from
Feb 21, 2018
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
4 changes: 2 additions & 2 deletions tests/integ/test_linear_learner.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

import sagemaker
from sagemaker.amazon.linear_learner import LinearLearner, LinearLearnerModel
from sagemaker.utils import name_from_base
from sagemaker.utils import name_from_base, sagemaker_timestamp

from tests.integ import DATA_DIR, REGION
from tests.integ.timeout import timeout, timeout_and_delete_endpoint_by_name
Expand Down Expand Up @@ -90,7 +90,7 @@ def test_linear_learner():
def test_async_linear_learner():

training_job_name = ""
endpoint_name = 'test-linear-learner-async-{}'.format(int(time.time()))
endpoint_name = 'test-linear-learner-async-{}'.format(sagemaker_timestamp())
sagemaker_session = sagemaker.Session(boto_session=boto3.Session(region_name=REGION))

with timeout(minutes=5):
Expand Down
7 changes: 4 additions & 3 deletions tests/integ/test_mxnet_train.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from sagemaker import Session
from sagemaker.mxnet.estimator import MXNet
from sagemaker.mxnet.model import MXNetModel
from sagemaker.utils import sagemaker_timestamp

from tests.integ import DATA_DIR, REGION
from tests.integ.timeout import timeout, timeout_and_delete_endpoint_by_name
Expand Down Expand Up @@ -49,7 +50,7 @@ def mxnet_training_job(sagemaker_session):


def test_attach_deploy(mxnet_training_job, sagemaker_session):
endpoint_name = 'test-mxnet-attach-deploy-{}'.format(int(time.time()))
endpoint_name = 'test-mxnet-attach-deploy-{}'.format(sagemaker_timestamp())

with timeout_and_delete_endpoint_by_name(endpoint_name, sagemaker_session, minutes=20):
estimator = MXNet.attach(mxnet_training_job, sagemaker_session=sagemaker_session)
Expand All @@ -61,7 +62,7 @@ def test_attach_deploy(mxnet_training_job, sagemaker_session):
def test_async_fit(sagemaker_session):

training_job_name = ""
endpoint_name = 'test-mxnet-attach-deploy-{}'.format(int(time.time()))
endpoint_name = 'test-mxnet-attach-deploy-{}'.format(sagemaker_timestamp())

with timeout(minutes=5):
script_path = os.path.join(DATA_DIR, 'mxnet_mnist', 'mnist.py')
Expand Down Expand Up @@ -91,7 +92,7 @@ def test_async_fit(sagemaker_session):


def test_deploy_model(mxnet_training_job, sagemaker_session):
endpoint_name = 'test-mxnet-deploy-model-{}'.format(int(time.time()))
endpoint_name = 'test-mxnet-deploy-model-{}'.format(sagemaker_timestamp())

with timeout_and_delete_endpoint_by_name(endpoint_name, sagemaker_session, minutes=20):
desc = sagemaker_session.sagemaker_client.describe_training_job(TrainingJobName=mxnet_training_job)
Expand Down