flaky test: cli thread commands > run / threads / thread / thread rm #265

Closed
opened 2026-05-14 13:09:19 +00:00 by xiaoju · 0 comments
Owner

现象

@uncaged/cli-workflowcli thread commands > run / threads / thread / thread rm 测试间歇性失败。

文件:packages/cli-workflow/__tests__/thread-cli.test.ts

连续跑 bun run test 时大约 50% 概率 fail,其余 103 个测试稳定 pass。

可能原因

  • 测试涉及 spawn 子进程 + 文件系统操作(threads.json、CAS),可能存在竞态
  • 进程退出时机 / 文件写入刷盘时序不确定

复现

cd ~/repos/uncaged-workflow
for i in $(seq 1 5); do bun run test 2>&1 | grep -E "(pass|fail).*run / threads"; done

标签

bug, flaky-test

## 现象 `@uncaged/cli-workflow` 的 `cli thread commands > run / threads / thread / thread rm` 测试间歇性失败。 文件:`packages/cli-workflow/__tests__/thread-cli.test.ts` 连续跑 `bun run test` 时大约 50% 概率 fail,其余 103 个测试稳定 pass。 ## 可能原因 - 测试涉及 spawn 子进程 + 文件系统操作(threads.json、CAS),可能存在竞态 - 进程退出时机 / 文件写入刷盘时序不确定 ## 复现 ```bash cd ~/repos/uncaged-workflow for i in $(seq 1 5); do bun run test 2>&1 | grep -E "(pass|fail).*run / threads"; done ``` ## 标签 bug, flaky-test
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: uncaged/workflow#265