fix: make schedule generation tests reliable (#33) #34
Reference in New Issue
Block a user
Delete Branch "fix/schedule-test-reliability"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
router.refresh()completesRoot Cause
The tests used
When I go to the tournament schedule pageto navigate away and back after generating a schedule. This created a race condition with the PrismaPg adapter connection pool: the POST handler's transaction committed on one connection, but the subsequent GET frompage.goto()could use a different pool connection that hadn't seen the commit yet.Fix
After clicking "Generate Schedule", the
ScheduleGeneratorcomponent callsrouter.refresh()which triggers a server-side re-fetch and re-render in-place. The test now waits for the round headers to appear on the same page with a 30s timeout, eliminating the navigation race condition entirely.Closes #33
Pull request closed