| OLD | NEW |
| 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 os | 8 import os |
| 9 import random | 9 import random |
| 10 import sys | 10 import sys |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 def _gen_request(self, properties=None, **kwargs): | 105 def _gen_request(self, properties=None, **kwargs): |
| 106 """Creates a TaskRequest.""" | 106 """Creates a TaskRequest.""" |
| 107 props = { | 107 props = { |
| 108 'command': [u'command1'], | 108 'command': [u'command1'], |
| 109 'dimensions': {u'pool': u'default'}, | 109 'dimensions': {u'pool': u'default'}, |
| 110 'env': {}, | 110 'env': {}, |
| 111 'execution_timeout_secs': 24*60*60, | 111 'execution_timeout_secs': 24*60*60, |
| 112 'io_timeout_secs': None, | 112 'io_timeout_secs': None, |
| 113 } | 113 } |
| 114 props.update(properties or {}) | 114 props.update(properties or {}) |
| 115 props['dimensions_dict'] = props.pop('dimensions') |
| 115 now = utils.utcnow() | 116 now = utils.utcnow() |
| 116 args = { | 117 args = { |
| 117 'created_ts': now, | 118 'created_ts': now, |
| 118 'name': 'Request name', | 119 'name': 'Request name', |
| 119 'priority': 50, | 120 'priority': 50, |
| 120 'properties': task_request.TaskProperties(**props), | 121 'properties': task_request.TaskProperties(**props), |
| 121 'expiration_ts': now + datetime.timedelta(seconds=60), | 122 'expiration_ts': now + datetime.timedelta(seconds=60), |
| 122 'tags': [u'tag:1'], | 123 'tags': [u'tag:1'], |
| 123 'user': 'Jesus', | 124 'user': 'Jesus', |
| 124 } | 125 } |
| (...skipping 1678 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1803 (['1d69b9f088008911'], 0, 0), | 1804 (['1d69b9f088008911'], 0, 0), |
| 1804 task_scheduler.cron_handle_bot_died('f.local')) | 1805 task_scheduler.cron_handle_bot_died('f.local')) |
| 1805 | 1806 |
| 1806 | 1807 |
| 1807 if __name__ == '__main__': | 1808 if __name__ == '__main__': |
| 1808 if '-v' in sys.argv: | 1809 if '-v' in sys.argv: |
| 1809 unittest.TestCase.maxDiff = None | 1810 unittest.TestCase.maxDiff = None |
| 1810 logging.basicConfig( | 1811 logging.basicConfig( |
| 1811 level=logging.DEBUG if '-v' in sys.argv else logging.CRITICAL) | 1812 level=logging.DEBUG if '-v' in sys.argv else logging.CRITICAL) |
| 1812 unittest.main() | 1813 unittest.main() |
| OLD | NEW |