mirror of
https://ghfast.top/https://github.com/aeroxw/easy-tdx.git
synced 2026-09-12 14:34:15 +08:00
根因:测试用 max_workers=1 串行执行 5 个任务,断言「前 2 个被淘汰」。 但 LRU 淘汰发生在 submit() 时,淘汰的是「当时最旧的非 running 任务」。 快机器上 t0 还在 running(被跳过),实际淘汰 t1/t2;慢机器(CI windows 3.12)上 t0 已完成,淘汰 t0/t1——取决于提交速度 vs 执行速度的竞态。 修复:不断言特定 task_id 被淘汰,改为验证不变量: (1) 最后提交的任务一定存活(LRU 最近) (2) 至少淘汰 2 个(5 - max_results 3) (3) 存活任务数 ≤ max_results 本地跑 10 次全过,不再 flaky。