CodeForPhilly / CodeForPhilly/codeforphilly-ng
flaky api tests: git clone from shared full-data fixture repo loses objects mid-copy under parallel workers
- 主要语言
- TypeScript
- 星标
- 1
- 派生
- 1
- 平均合并
- 5 天 3 小时
- 30 天内合并 PR
- 9
描述
Seen twice on 2026-09-09 in CI on the same commit (`96b71ef`, merge of #157, which touched only `apps/web`):
- push run: `tests/slug-redirect.test.ts > never intercepts /api/* paths`
- pull_request run: `tests/avatar-upload.test.ts > 404s for a missing person` and `> rejects unsupported MIME types with 422`
All with the same error from `apps/api/tests/helpers/seed-fixtures.ts` cloning the bare fixture repo created by `tests/helpers/test-full-repo.ts`:
```
Error: Command failed: git clone /tmp/cfp-full-data-XXXX/data.git /tmp/cfp-seed-wt-YYYY
fatal: failed to copy file to '/tmp/cfp-seed-wt-YYYY/.git/objects/71/fdd3...': No such file or directory
```
Different test files, different temp dirs, same shape: a local `git clone` (hardlink/copy of loose objects) races with something mutating the source repo's object store while it runs. Suspects: another worker's transaction on the same shared fixture repo (gitsheets 2.x Rust core landed on `develop` via #151 and may repack/prune loose objects), or a cleanup `rm` in a sibling file's `afterEach`. Locally the suite passes with `--maxWorkers=2`; CI uses the default worker count.
Options: give each test file its own fixture repo (no shared source), clone with `--no-hardlinks`/`file://` (forces a pack transfer instead of per-object copies), or serialize the clone behind a lock. Re-running the job passes, so this is a flake, not a regression, but it will keep failing release CI at random.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01RdRwHvDupRLV8GuJpYKzEr
贡献指南
这个仓库没有索引到贡献指南
调研方向
从 apps/api/tests/helpers/seed-fixtures.ts 和 tests/helpers/test-full-repo.ts 开始,然后使用 CI 的默认 worker 数量重现列出的 slug-redirect 和 avatar-upload 测试。在并行 worker 运行期间,跟踪共享 fixture 的创建、克隆和清理;完成的标准是这些测试在 git clone 期间不再间歇性失败,并且完整的并行测试套件保持稳定。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- git, typescript
- 领域
- ci-cd, testing
- Issue 类型
- 缺陷
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 活跃
- 描述清晰度
- 基本清楚
- 新手友好度
- 52/100