| 105 | |
| 106 | |
| 107 | static TaskInfo createTaskInfo(const SlaveID& slaveId) |
| 108 | { |
| 109 | // Using a static local variable to avoid the cost of re-parsing. |
| 110 | static const Resources resources = Resources::parse("cpus:0.1;mem:5").get(); |
| 111 | |
| 112 | TaskInfo taskInfo = createTask( |
| 113 | slaveId, |
| 114 | resources, |
| 115 | "dummy command"); |
| 116 | |
| 117 | Labels* labels = taskInfo.mutable_labels(); |
| 118 | |
| 119 | for (size_t i = 0; i < 10; i++) { |
| 120 | const string index = stringify(i); |
| 121 | *(labels->add_labels()) = |
| 122 | protobuf::createLabel("key" + index, "value" + index); |
| 123 | } |
| 124 | |
| 125 | return taskInfo; |
| 126 | } |
| 127 | |
| 128 | |
| 129 | // A fake agent currently just for testing reregisterations. |
no test coverage detected