File tree 3 files changed +9
-7
lines changed
test-suite/tests/python/test-context-values
3 files changed +9
-7
lines changed Original file line number Diff line number Diff line change 13
13
&& apk --no-cache add py-curl \
14
14
&& easy_install-2.7 "urlgrabber==3.9.1" \
15
15
\
16
- && easy_install-2.7 "botocore==1.4.1 " \
17
- && easy_install-2.7 "boto3==1.2.6 " \
16
+ && easy_install-2.7 "botocore==1.4.17 " \
17
+ && easy_install-2.7 "boto3==1.3.1 " \
18
18
\
19
19
&& rm -rf /tmp/*
20
20
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ def __init__(self):
33
33
self .memory_limit_in_mb = int (getTASK_MAXRAM () / 1024 / 1024 )
34
34
35
35
def get_remaining_time_in_millis (self ):
36
- remaining = plannedEnd - time .time ()
36
+ remaining = plannedEnd - int ( time .time () )
37
37
if remaining < 0 :
38
38
remaining = 0
39
39
return remaining * 1000
@@ -112,8 +112,10 @@ def getPAYLOAD_FILE():
112
112
113
113
114
114
def getTASK_TIMEOUT ():
115
- return os .environ .get ('TASK_TIMEOUT' ) or 3600
116
-
115
+ try :
116
+ return int (os .environ .get ('TASK_TIMEOUT' ))
117
+ except ValueError :
118
+ return 3600
117
119
118
120
def getTASK_MAXRAM ():
119
121
# IronWorker uses MAXMEM, Hybrid uses MAXRAM.
@@ -190,7 +192,7 @@ def filter(self, record):
190
192
}
191
193
logging .config .dictConfig (loggingConfig )
192
194
193
- plannedEnd = time .time () + getTASK_TIMEOUT ()
195
+ plannedEnd = int ( time .time () ) + getTASK_TIMEOUT ()
194
196
195
197
debugging and print ('os.environ = ' , os .environ )
196
198
debugging and print ('/mnt content = ' , os .listdir ("/mnt" ))
Original file line number Diff line number Diff line change 5
5
def run (event , context ):
6
6
print ("Function name is set:" , not (context .function_name is None ))
7
7
print ("Function version is set:" , not (context .function_version is None ))
8
- print ("Memory limit in MB (grater or equal than 100) :" , context .memory_limit_in_mb > 100 )
8
+ print ("Memory limit in MB is positive :" , context .memory_limit_in_mb > 0 )
9
9
print ("AWS request ID is set:" , not (context .aws_request_id is None ))
10
10
11
11
remaining1 = context .get_remaining_time_in_millis ()
You can’t perform that action at this time.
0 commit comments