Skip to content

Commit 2838a6d

Browse files
committed
Add 30s cap time for tag tests
1 parent d170f19 commit 2838a6d

File tree

5 files changed

+22
-0
lines changed

5 files changed

+22
-0
lines changed

pytest.ini

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# The pytest framework makes it easy to write small tests,
2+
# yet scales to support complex functional testing for applications and libraries.
3+
4+
[pytest]
5+
markers =
6+
timeout: mark a test as a timeout.

tests/integ/sagemaker/lineage/test_action.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
import datetime
1717
import logging
1818

19+
import pytest
20+
1921
from sagemaker.lineage import action
2022

2123

@@ -80,6 +82,7 @@ def test_list(action_objs, sagemaker_session):
8082
assert action_names
8183

8284

85+
@pytest.mark.timeout(30)
8386
def test_tag(action_obj, sagemaker_session):
8487
tag = {"Key": "foo", "Value": "bar"}
8588
action_obj.set_tag(tag)
@@ -96,6 +99,7 @@ def test_tag(action_obj, sagemaker_session):
9699
assert actual_tags[0] == tag
97100

98101

102+
@pytest.mark.timeout(30)
99103
def test_tags(action_obj, sagemaker_session):
100104
tags = [{"Key": "foo1", "Value": "bar1"}]
101105
action_obj.set_tags(tags)

tests/integ/sagemaker/lineage/test_artifact.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
import logging
1818
import time
1919

20+
import pytest
21+
2022
from sagemaker.lineage import artifact
2123

2224

@@ -111,6 +113,7 @@ def test_downstream_trials(trial_associated_artifact, trial_obj, sagemaker_sessi
111113
assert trial_obj.trial_name in trials
112114

113115

116+
@pytest.mark.timeout(30)
114117
def test_tag(artifact_obj, sagemaker_session):
115118
tag = {"Key": "foo", "Value": "bar"}
116119
artifact_obj.set_tag(tag)
@@ -127,6 +130,7 @@ def test_tag(artifact_obj, sagemaker_session):
127130
assert actual_tags[0] == tag
128131

129132

133+
@pytest.mark.timeout(30)
130134
def test_tags(artifact_obj, sagemaker_session):
131135
tags = [{"Key": "foo1", "Value": "bar1"}]
132136
artifact_obj.set_tags(tags)

tests/integ/sagemaker/lineage/test_association.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
import datetime
1717
import time
1818

19+
import pytest
20+
1921
from sagemaker.lineage import association
2022

2123

@@ -55,6 +57,7 @@ def test_list(association_objs, sagemaker_session):
5557
assert association_keys_listed
5658

5759

60+
@pytest.mark.timeout(30)
5861
def test_set_tag(association_obj, sagemaker_session):
5962
tag = {"Key": "foo", "Value": "bar"}
6063
association_obj.set_tag(tag)
@@ -72,6 +75,7 @@ def test_set_tag(association_obj, sagemaker_session):
7275
assert actual_tags[0] == tag
7376

7477

78+
@pytest.mark.timeout(30)
7579
def test_tags(association_obj, sagemaker_session):
7680
tags = [{"Key": "foo1", "Value": "bar1"}]
7781
association_obj.set_tags(tags)

tests/integ/sagemaker/lineage/test_context.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
import datetime
1717
import logging
1818

19+
import pytest
20+
1921
from sagemaker.lineage import context
2022

2123

@@ -78,6 +80,7 @@ def test_list(context_objs, sagemaker_session):
7880
assert context_names
7981

8082

83+
@pytest.mark.timeout(30)
8184
def test_tag(context_obj, sagemaker_session):
8285
tag = {"Key": "foo", "Value": "bar"}
8386
context_obj.set_tag(tag)
@@ -94,6 +97,7 @@ def test_tag(context_obj, sagemaker_session):
9497
assert actual_tags[0] == tag
9598

9699

100+
@pytest.mark.timeout(30)
97101
def test_tags(context_obj, sagemaker_session):
98102
tags = [{"Key": "foo1", "Value": "bar1"}]
99103
context_obj.set_tags(tags)

0 commit comments

Comments
 (0)