CodeForPhilly / CodeForPhilly/codeforphilly-ng

flaky api tests: git clone from shared full-data fixture repo loses objects mid-copy under parallel workers

Đang mở
#171 0 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
TypeScript
Star
1
Fork
1
Merge trung bình
5 ngày 3 giờ
Pull request đã merge (30 ngày)
9

Mô tả

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

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Hướng nghiên cứu

Bắt đầu với apps/api/tests/helpers/seed-fixtures.ts và tests/helpers/test-full-repo.ts, sau đó tái hiện các test slug-redirect và avatar-upload được liệt kê bằng số worker mặc định của CI. Theo dõi việc tạo, clone và dọn dẹp các fixture dùng chung trong khi các worker chạy song song; hoàn thành nghĩa là các test đó không còn thỉnh thoảng thất bại trong quá trình git clone và toàn bộ suite chạy song song vẫn ổn định.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
git, typescript
Lĩnh vực
ci-cd, testing
Loại issue
Lỗi
Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức độ hoạt động
Sôi nổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
52/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.