internal/session: TestWorkNoWorkerCanDoStopsARunningWorkerAndLandsOnThePerson races a 30 s wall and fails beside another suite
Maintainer thường phản hồi trong vòng 1 ngày
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức phù hợp với người mới
- 78/100
- Loại issue
- Lỗi
- Độ rõ ràng
- Đặc tả rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- go
- Lĩnh vực
- testing-qa
Hướng nghiên cứu
Start with TestWorkNoWorkerCanDoStopsARunningWorkerAndLandsOnThePerson and the eight time.After(30 * time.Second) sites in internal/session/task_divide_sketch_test.go. Run the focused session test beside the internal/tui3 suite with GOMAXPROCS=4 to reproduce the race, then inspect the held completer and worker-stop acknowledgement. Done means no fixed 30-second waits remain, waits respect owned synchronization or the test deadline, and the concurrent -count=5 run passes.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
What happened
2026-09-21, dev@17ae56d34 plus the seven-plus-six commits of #1336 (which touch nothing in the task harness), running the repository's own gate on a laptop while a second full suite and a read-only reviewer were also running:
make pr-ready
…
--- FAIL: TestWorkNoWorkerCanDoStopsARunningWorkerAndLandsOnThePerson (37.55s)
task_divide_sketch_test.go:594: the worker was never stopped for work only a person can do
FAIL
FAIL github.com/Agent-Field/codeaf/internal/session 799.740s
The package took 800 s against the 210 s constrained-runner baseline in CLAUDE.md. CI's touched packages job on the same head passed. The same test on a quiet box:
go test -count=3 -run '^TestWorkNoWorkerCanDoStopsARunningWorkerAndLandsOnThePerson$' ./internal/session/
ok github.com/Agent-Field/codeaf/internal/session 0.879s
So it is the shape CLAUDE.md says is a bug report and not a known one: a session test that fails only when other suites run beside it.
Replication
Deterministic (no model). Run the session suite while another heavy suite runs beside it, on a box with a few cores:
GOMAXPROCS=4 go test -count=1 -timeout 15m ./internal/tui3/ &
GOMAXPROCS=4 go test -count=1 -timeout 15m -run 'TestWork' ./internal/session/
What a developer sees today, some of the time: the --- FAIL above after 30 s of waiting. On a quiet box it passes in well under a second.
Field (real models). Not applicable: this is a test's own wall, no product door.
Where
TestWorkNoWorkerCanDoStopsARunningWorkerAndLandsOnThePerson in internal/session/task_divide_sketch_test.go, and its siblings in the same file: each waits on a channel with case <-time.After(30 * time.Second) (search that string; eight sites). The worker being stopped is real work driven by a held completer (completer.hold); on a loaded box the stop lands after the thirty seconds have gone.
The fix
A test in this package should not lose a race against wall time. Either the wait is on a sync point the harness owns (the held completer's release, the worker's own stop acknowledgement) with no timer at all, or the ceiling is the test's deadline (t.Deadline() minus a margin) rather than a fixed thirty seconds. CLAUDE.md's learned preference already says it: deterministic clocks over real sleeps.
Acceptance
- e2e: not applicable — nothing crosses a product door; the defect is the test's own timer.
- Unit: every wait in
task_divide_sketch_test.gois either a sync point with no timer or bounded by the test deadline;grep -c 'time.After(30' internal/session/task_divide_sketch_test.gois 0. - Unit: the test passes with
-count=5whilego test ./internal/tui3/runs beside it on a 4-core box. - No manual page or change entry is involved.
- Ngôn ngữ chính
- Go
- Star
- 115
- Fork
- 14
- Merge trung bình
- 9 giờ 35 phút
- Pull request đã merge (30 ngày)
- 752
Chuẩn bị môi trường
Chúng tôi chưa kiểm tra các tệp thiết lập môi trường của dự án này. Hãy bắt đầu từ README và xem hướng dẫn đóng góp lần đầu của chúng tôi để biết các bước chung.
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của Agent-Field/CodeAF
-
area:chat bug sev:papercut
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 86/100
Agent-Field/CodeAF#1592 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:headless bug sev:critical
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Agent-Field/CodeAF#1566 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
tui3: slash command completion inserts bare command prefix into prompt instead of navigatingĐang mởarea:chat bug sev:critical
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Agent-Field/CodeAF#1548 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:chat feature
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
Agent-Field/CodeAF#1510 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
area:tests bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
Agent-Field/CodeAF#1489 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của Agent-Field/CodeAF
Issue tương tự
-
area/proxy kind/bug priority/backlog triage/accepted
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
lexfrei/cloudflare-tunnel-gateway-controller#840 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
kind/bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
Maintainer thường phản hồi trong vòng 7 ngày
-
bug needs triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
bug P2 reliability
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 88/100
afreidah/s3-orchestrator#1564 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
blinklabs-io/gouroboros#2577 ·
Maintainer thường phản hồi trong vòng 1 ngày