Author orch Markdown test plan
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
# Case: `ready-orders-by-priority-and-respects-limit`
|
||||
|
||||
## 用例意义
|
||||
|
||||
验证 `ready` 会先按优先级排序可调度任务,再应用 `--limit` 截断结果,而不是按创建顺序直接裁剪。
|
||||
|
||||
## 前置条件
|
||||
|
||||
- 已存在 run `run_blog_005`
|
||||
- 该 run 下有至少三个无依赖且处于 `ready` 的任务
|
||||
- 三个任务优先级分别为 `high`、`normal`、`low`
|
||||
|
||||
## 输入
|
||||
|
||||
```bash
|
||||
orch --db TMPDIR/coord.db --json run init --run run_blog_005 --goal "Validate ready ordering"
|
||||
orch --db TMPDIR/coord.db --json task add --run run_blog_005 --task T1 --title "Low priority task" --priority low
|
||||
orch --db TMPDIR/coord.db --json task add --run run_blog_005 --task T2 --title "Normal priority task" --priority normal
|
||||
orch --db TMPDIR/coord.db --json task add --run run_blog_005 --task T3 --title "High priority task" --priority high
|
||||
orch --db TMPDIR/coord.db --json ready --run run_blog_005 --limit 2
|
||||
```
|
||||
|
||||
## 预期输出
|
||||
|
||||
- `ready` 退出码为 `0`
|
||||
- `data.tasks` 长度为 `2`
|
||||
- 第一个返回项是高优先级任务 `T3`
|
||||
- 第二个返回项是普通优先级任务 `T2`
|
||||
- 低优先级任务 `T1` 不出现在本次结果中
|
||||
|
||||
## 断言结论
|
||||
|
||||
- `ready` 的用户可见顺序是 `high -> normal -> low`
|
||||
- `--limit` 的截断发生在优先级排序之后,因此 leader 可以依赖该命令优先看到更重要的可调度任务
|
||||
|
||||
## 补充约束
|
||||
|
||||
- 当多个 ready 任务优先级相同时,当前实现会按创建时间升序稳定返回
|
||||
- 未显式传 `--limit` 时,默认上限仍是 `20`
|
||||
Reference in New Issue
Block a user