Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(115)

Side by Side Diff: appengine/swarming/server/task_request_test.py

Issue 2984773002: Change task timeout limit to 3 days (Closed)
Patch Set: fix error message Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « appengine/swarming/server/task_request.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright 2014 The LUCI Authors. All rights reserved. 2 # Copyright 2014 The LUCI Authors. All rights reserved.
3 # Use of this source code is governed under the Apache License, Version 2.0 3 # Use of this source code is governed under the Apache License, Version 2.0
4 # that can be found in the LICENSE file. 4 # that can be found in the LICENSE file.
5 5
6 import datetime 6 import datetime
7 import logging 7 import logging
8 import random 8 import random
9 import sys 9 import sys
10 import unittest 10 import unittest
(...skipping 552 matching lines...) Expand 10 before | Expand all | Expand 10 after
563 mkreq(_gen_request(properties=dict(env={}))) 563 mkreq(_gen_request(properties=dict(env={})))
564 564
565 # Priority. 565 # Priority.
566 with self.assertRaises(datastore_errors.BadValueError): 566 with self.assertRaises(datastore_errors.BadValueError):
567 mkreq(_gen_request(priority=task_request.MAXIMUM_PRIORITY+1)) 567 mkreq(_gen_request(priority=task_request.MAXIMUM_PRIORITY+1))
568 mkreq(_gen_request(priority=task_request.MAXIMUM_PRIORITY)) 568 mkreq(_gen_request(priority=task_request.MAXIMUM_PRIORITY))
569 569
570 # Execution timeout. 570 # Execution timeout.
571 with self.assertRaises(datastore_errors.BadValueError): 571 with self.assertRaises(datastore_errors.BadValueError):
572 mkreq(_gen_request( 572 mkreq(_gen_request(
573 properties=dict(execution_timeout_secs=task_request._ONE_DAY_SECS+1))) 573 properties=dict(
574 execution_timeout_secs=task_request._THREE_DAY_SECS+1)))
574 mkreq(_gen_request( 575 mkreq(_gen_request(
575 properties=dict(execution_timeout_secs=task_request._ONE_DAY_SECS))) 576 properties=dict(execution_timeout_secs=task_request._THREE_DAY_SECS)))
576 577
577 # Expiration. 578 # Expiration.
578 now = utils.utcnow() 579 now = utils.utcnow()
579 with self.assertRaises(datastore_errors.BadValueError): 580 with self.assertRaises(datastore_errors.BadValueError):
580 mkreq(_gen_request( 581 mkreq(_gen_request(
581 created_ts=now, 582 created_ts=now,
582 expiration_ts=now + datetime.timedelta( 583 expiration_ts=now + datetime.timedelta(
583 seconds=task_request._MIN_TIMEOUT_SECS-1))) 584 seconds=task_request._MIN_TIMEOUT_SECS-1)))
584 with self.assertRaises(datastore_errors.BadValueError): 585 with self.assertRaises(datastore_errors.BadValueError):
585 mkreq(_gen_request( 586 mkreq(_gen_request(
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
742 with self.assertRaises(datastore_errors.BadValueError): 743 with self.assertRaises(datastore_errors.BadValueError):
743 task_request.SecretBytes(secret_bytes='a'*(20*1024+1)).put() 744 task_request.SecretBytes(secret_bytes='a'*(20*1024+1)).put()
744 745
745 746
746 if __name__ == '__main__': 747 if __name__ == '__main__':
747 if '-v' in sys.argv: 748 if '-v' in sys.argv:
748 unittest.TestCase.maxDiff = None 749 unittest.TestCase.maxDiff = None
749 logging.basicConfig( 750 logging.basicConfig(
750 level=logging.DEBUG if '-v' in sys.argv else logging.ERROR) 751 level=logging.DEBUG if '-v' in sys.argv else logging.ERROR)
751 unittest.main() 752 unittest.main()
OLDNEW
« no previous file with comments | « appengine/swarming/server/task_request.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698