Fix the data races and the test timeout that fail make test, on main (closes #104) #110

Merged
clawbot merged 1 commits from fix/104-main into main 2026-10-02 10:13:29 +02:00
Collaborator

Brings the fix for #104 to main, and nothing else. main is red: the make test step of the Docker build fails on data races in the internal/handlers and internal/ircserver tests.

This branch is the commit that #105 squashed into next (915f56e), whose parent is the current main, so the diff is exactly that fix:

  • The HTTP router is built in the server's start hook (configure, enableSentry, SetupRoutes, in that order) before serving starts, so a started server has its routes.
  • The goroutine that sends queued messages to an IRC client reads the client's nick under its lock.
  • Both go test runs in make test use -timeout 120s: internal/handlers takes over 30s under -race in the Docker build.

Done when main passes docker build --no-cache . from a fresh clone. prod changes only by the owner's deploy.

Model: opus-5-5

Brings the fix for https://git.eeqj.de/sneak/neoirc/issues/104 to `main`, and nothing else. `main` is red: the `make test` step of the Docker build fails on data races in the `internal/handlers` and `internal/ircserver` tests. This branch is the commit that https://git.eeqj.de/sneak/neoirc/pulls/105 squashed into `next` (`915f56e`), whose parent is the current `main`, so the diff is exactly that fix: - The HTTP router is built in the server's start hook (configure, enableSentry, SetupRoutes, in that order) before serving starts, so a started server has its routes. - The goroutine that sends queued messages to an IRC client reads the client's nick under its lock. - Both `go test` runs in `make test` use `-timeout 120s`: `internal/handlers` takes over 30s under `-race` in the Docker build. Done when `main` passes `docker build --no-cache .` from a fresh clone. `prod` changes only by the owner's deploy. Model: opus-5-5
clawbot added the needs-review label 2026-10-02 02:50:12 +02:00
clawbot self-assigned this 2026-10-02 02:50:12 +02:00
clawbot added 1 commit 2026-10-02 02:50:13 +02:00
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
Author
Collaborator

PASS: this brings only the fix for #104 to main, the same change reviewed in #105, and it removes both data races without skipping, deleting or changing any test.

  • Judgement call: the 120-second go test timeout departs from the 30-second timeout in REPO_POLICIES.md; accepted on the ruling at #105 (comment).
  • Judgement call: building the router in the server's start hook departs from the server start-up example in CONVENTIONS.md; the plan on #104 prescribes it.

Model: opus-5-5

**PASS**: this brings only the fix for https://git.eeqj.de/sneak/neoirc/issues/104 to `main`, the same change reviewed in https://git.eeqj.de/sneak/neoirc/pulls/105, and it removes both data races without skipping, deleting or changing any test. - Judgement call: the 120-second `go test` timeout departs from the 30-second timeout in `REPO_POLICIES.md`; accepted on the ruling at https://git.eeqj.de/sneak/neoirc/pulls/105#issuecomment-110018. - Judgement call: building the router in the server's start hook departs from the server start-up example in `CONVENTIONS.md`; the plan on https://git.eeqj.de/sneak/neoirc/issues/104 prescribes it. Model: opus-5-5
clawbot added merge-ready and removed needs-review labels 2026-10-02 03:50:12 +02:00
clawbot removed their assignment 2026-10-02 03:50:13 +02:00
sneak was assigned by clawbot 2026-10-02 03:50:13 +02:00
clawbot merged commit e3324407ca into main 2026-10-02 10:13:29 +02:00
clawbot deleted branch fix/104-main 2026-10-02 10:13:29 +02:00
sneak was unassigned by clawbot 2026-10-02 10:13:42 +02:00
clawbot self-assigned this 2026-10-02 10:13:42 +02:00
clawbot removed the merge-ready label 2026-10-02 10:13:42 +02:00
Sign in to join this conversation.