Fix the data races and the test timeout that fail make test (closes #104)
check / check (push) Successful in 3s
check / check (push) Successful in 3s
The HTTP server built its router inside the goroutine that starts serving, so the start hook returned before the router existed, and the internal/handlers tests raced with it or hit a nil router. The start hook now runs configure, enableSentry and SetupRoutes, in that order, then serves in the background. The goroutine that sends queued messages to an IRC client read c.nick without c.mu while NICK changed it. Every such read now takes the lock. Under -race in the Docker build, internal/handlers takes over 30s on database work, not clock waits, so both go test runs in make test use -timeout 120s. The || retry stays (#101). Model: opus-5-5
This commit was merged in pull request #105.
This commit is contained in:
@@ -32,7 +32,7 @@ fmt-check:
|
||||
@test -z "$$(gofmt -l .)" || (echo "Files not formatted:" && gofmt -l . && exit 1)
|
||||
|
||||
test: ensure-web-dist
|
||||
go test -timeout 30s -race -cover ./... || go test -timeout 30s -race -v ./...
|
||||
go test -timeout 120s -race -cover ./... || go test -timeout 120s -race -v ./...
|
||||
|
||||
# check runs all validation without making changes
|
||||
# Used by CI and Docker build — fails if anything is wrong
|
||||
|
||||
Reference in New Issue
Block a user