You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
TEST-04: Wall-clock sleeps for async synchronization (~90 frontend setTimeout waits, several Go sleeps) #36
Evidence:
43 occurrences of 50ms await new Promise(resolve => setTimeout(resolve, 50)) plus 25 of 10ms and 3 of 100ms across frontend suites, used as fixed waits for async handlers (fake timers are used elsewhere, so the alternative is known). Go: a 20ms sleep to assert a goroutine did NOT fire, 250ms/200ms sleeps against real TTLs, a 100ms "Simulate actual work" sleep.
Impact:
3-5s of dead wall time per frontend run plus CI-load-sensitive flake windows; the 20ms negative-assertion window can miss a slow wrongly-spawned goroutine (false green on the Lambda invariant it guards). The anti-pattern is forbidden by the project's feedback_no_sleep_in_tests rule.
Recommendation:
Frontend: microtask flushes, fake timers, or awaiting the mocked API promise. Go: inject a hook/channel for the negative assertion; fake clock for TTL tests.
Source: docs/reviews/codebase-review-2026-06-10.md (automated multi-dimension code review, adversarially verified for P1/P2)
Status update (2026-10-28): #1568 (Go: injectable clock for the in-memory rate limiter, deterministic shutdown-wait test) and #1569 (frontend: 123 fixed sleeps replaced with promise flushes, plus a guard test) merged.
Left: a few remaining sleeps that stand in for synchronization, for example internal/archera/provider_cancel_test.go:111.
Activity
IAmJSD commentedon Oct 23, 2026
Claiming: working on this
Merge remote-tracking branch 'origin/main' into fix/issue-36
test: wait on goroutines and barriers instead of wall-clock sleeps in…
test(frontend): wait for async handlers instead of sleeping in unit t…
test: drive the in-memory rate limiter and the shutdown wait test wit…
IAmJSD commentedon Oct 28, 2026
Status update (2026-10-28): #1568 (Go: injectable clock for the in-memory rate limiter, deterministic shutdown-wait test) and #1569 (frontend: 123 fixed sleeps replaced with promise flushes, plus a guard test) merged.
Left: a few remaining sleeps that stand in for synchronization, for example
internal/archera/provider_cancel_test.go:111.