File tree Expand file tree Collapse file tree 1 file changed +16
-5
lines changed Expand file tree Collapse file tree 1 file changed +16
-5
lines changed Original file line number Diff line number Diff line change 13
13
14
14
import datetime
15
15
16
+ import logging
17
+
16
18
from smexperiments import trial
17
19
from smexperiments .search_expression import SearchExpression , Filter , Operator
18
20
from tests .helpers import retry
@@ -109,15 +111,24 @@ def test_search(sagemaker_boto_client):
109
111
110
112
def test_add_remove_trial_component (trial_obj , trial_component_obj ):
111
113
trial_obj .add_trial_component (trial_component_obj )
114
+ logging .info (f"Added trial component { trial_component_obj .trial_component_name } to trial { trial_obj .trial_name } " )
112
115
113
- def validate ():
116
+ def validate_add ():
114
117
trial_components = list (trial_obj .list_trial_components ())
115
- assert 1 == len (trial_components )
116
- trial_obj .remove_trial_component (trial_component_obj )
118
+ assert 1 == len (trial_components ), "Expected trial component to be included in trials list of TC"
119
+
120
+ retry (validate_add )
121
+
122
+ trial_obj .remove_trial_component (trial_component_obj )
123
+ logging .info (
124
+ f"Removed trial component { trial_component_obj .trial_component_name } from trial { trial_obj .trial_name } "
125
+ )
126
+
127
+ def validate_remove ():
117
128
trial_components = list (trial_obj .list_trial_components ())
118
- assert 0 == len (trial_components )
129
+ assert 0 == len (trial_components ), "Expected trial component to be removed from trials list of TC"
119
130
120
- retry (validate , num_attempts = 4 )
131
+ retry (validate_remove )
121
132
122
133
123
134
def test_save (trial_obj , sagemaker_boto_client ):
You can’t perform that action at this time.
0 commit comments