fix(javaTest): close invalid history inputs explicitly
This commit is contained in:
@@ -71,19 +71,19 @@ git commit -m "fix(javaTest): validate route quality inputs"
|
||||
**Interfaces:**
|
||||
- 不新增生产 API;测试通过现有 `HistoricalSimulationInput`、`SimulationConfig` 和 `HistoricalDispatchSimulator.simulate(...)` 验证业务闭环。
|
||||
|
||||
- [ ] **Step 1: 写未来到达与优先级测试**
|
||||
- [x] **Step 1: 写未来到达与优先级测试**
|
||||
|
||||
构造两个站点路线和两条任务:低优先级任务在 `t=0` 到达,高优先级任务在仿真时间 `t=5000` 到达。断言 `t<5000` 的事件中不存在高优先级任务 `ASSIGN`,任务到达后它按优先级先获得 `ASSIGN`;另保留队列 aging 单测证明长期低优先级任务不会饥饿。
|
||||
|
||||
- [ ] **Step 2: 写无路失效关闭测试**
|
||||
- [x] **Step 2: 写无路失效关闭测试**
|
||||
|
||||
构造已知但被 `GridMap.block(target)` 永久阻断的服务目标,运行模拟并断言该任务为 `FAILED`、reason=`NO_ROUTE`、无 `ASSIGN`/`COMPLETE`,且结果数量仍保持闭环。对未知站点输入继续由 normalizer 形成 `HistoricalDispatchFailure`,断言同样进入明确失败结果而不是等待。
|
||||
|
||||
- [ ] **Step 3: 写 PLC 重试边界测试**
|
||||
- [x] **Step 3: 写 PLC 重试边界测试**
|
||||
|
||||
使用现有 `DeterministicFaultPlan` 注入一次 `SEND_FAILURE`,断言任务保持未移动并在后续 tick 产生 `PLC_RETRY`;使用重试上限夹具验证超过上限时 reason 非空且不伪造 `COMPLETED`。
|
||||
|
||||
- [ ] **Step 4: 运行专项 GREEN**
|
||||
- [x] **Step 4: 运行专项 GREEN**
|
||||
|
||||
```bash
|
||||
mvn -f javaTest/pom.xml -Dtest=HistoricalDispatchSimulatorTest,SimulationTaskQueueTest,HistoricalDispatchFaultMatrixTest test
|
||||
@@ -91,7 +91,7 @@ mvn -f javaTest/pom.xml -Dtest=HistoricalDispatchSimulatorTest,SimulationTaskQue
|
||||
|
||||
预期新旧测试全部通过;若生产代码行为与测试暴露的状态不一致,先添加最小生产修复,再重新运行同一命令。
|
||||
|
||||
- [ ] **Step 5: 提交**
|
||||
- [x] **Step 5: 提交**
|
||||
|
||||
```bash
|
||||
git add javaTest/src/test/java/com/ft546/wcs/shadow/history/simulation/HistoricalDispatchSimulatorTest.java javaTest/src/test/java/com/ft546/wcs/shadow/history/simulation/SimulationTaskQueueTest.java
|
||||
@@ -108,25 +108,25 @@ git commit -m "test(javaTest): prove history dispatch boundary states"
|
||||
**Interfaces:**
|
||||
- 保持 `CorridorReservationManager.replaceRoute(...)` 原子接口和 `TrafficHoldTracker` 第三次触发协议不变。
|
||||
|
||||
- [ ] **Step 1: 锁定旧预约回滚**
|
||||
- [x] **Step 1: 锁定旧预约回滚**
|
||||
|
||||
在替换失败测试中同时断言旧路线每条边仍由原任务持有、其他同向持有者仍存在、没有新路线残留;在成功测试中断言不再使用的旧边释放且共享边保留。
|
||||
|
||||
- [ ] **Step 2: 锁定 HOLD 集成行为**
|
||||
- [x] **Step 2: 锁定 HOLD 集成行为**
|
||||
|
||||
扩展模拟测试断言第三次相同交通 HOLD 产生一次 `REROUTE_TRIGGER`,失败替换产生 `REROUTE_REJECTED` 且原路线继续执行;成功替换后在下一次 MOVE 前不重复产生普通重规划。
|
||||
|
||||
- [ ] **Step 3: 锁定死锁 watchdog**
|
||||
- [x] **Step 3: 锁定死锁 watchdog**
|
||||
|
||||
增加连续无进展达到阈值才判死锁、未来到达任务不判死锁、车辆 MOVE 后计数清零的测试;确认 `SimulationInvariantSummary.deadlocks` 与异常路径均可追溯。
|
||||
|
||||
- [ ] **Step 4: 运行专项 GREEN**
|
||||
- [x] **Step 4: 运行专项 GREEN**
|
||||
|
||||
```bash
|
||||
mvn -f javaTest/pom.xml -Dtest=CorridorReservationManagerTest,HistoricalDispatchSimulatorTest,SimulationProgressWatchdogTest,TrafficHoldTrackerTest test
|
||||
```
|
||||
|
||||
- [ ] **Step 5: 提交**
|
||||
- [x] **Step 5: 提交**
|
||||
|
||||
```bash
|
||||
git add javaTest/src/test/java/com/ft546/wcs/shadow/history/simulation
|
||||
|
||||
Reference in New Issue
Block a user