Martin Blanchard pushed to branch mablanch/117-job-scheduler-refactoring at BuildGrid / buildgrid
Commits:
-
eb345291
by Martin Blanchard at 2018-10-17T14:55:29Z
1 changed file:
Changes:
| ... | ... | @@ -16,9 +16,18 @@ |
| 16 | 16 |
import random
|
| 17 | 17 |
import time
|
| 18 | 18 |
|
| 19 |
+from buildgrid._protos.build.bazel.remote.execution.v2 import remote_execution_pb2
|
|
| 20 |
+ |
|
| 19 | 21 |
|
| 20 | 22 |
def work_dummy(context, lease):
|
| 21 | 23 |
""" Just returns lease after some random time
|
| 22 | 24 |
"""
|
| 25 |
+ lease.result.Clear()
|
|
| 26 |
+ |
|
| 23 | 27 |
time.sleep(random.randint(1, 5))
|
| 28 |
+ |
|
| 29 |
+ action_result = remote_execution_pb2.ActionResult()
|
|
| 30 |
+ |
|
| 31 |
+ lease.result.Pack(action_result)
|
|
| 32 |
+ |
|
| 24 | 33 |
return lease
|
