Run the internal/handlers tests in parallel (closes #194)
check / check (push) Waiting to run

The handlers tests ran one at a time because config.New writes the
global viper instance. Each test spends most of its time in SQLite
under the race detector, so run in a row they took longer than the
20-second target.

Every test and subtest now calls t.Parallel(), as the ircserver and
db tests already do. A mutex in newTestServerWith makes tests start
their servers one at a time, since config.New writes viper and the
server reads it as it starts. No test is removed or otherwise
changed.

Model: opus-5-5
Co-authored-by: clawbot <sneak+clawbot@sneak.cloud>
This commit was merged in pull request #204.
This commit is contained in:
2026-10-27 08:28:28 +01:00
committed by clawbot
parent c61cc847d9
commit a7f9bebe6a
2 changed files with 284 additions and 5 deletions
File diff suppressed because it is too large Load Diff
+10 -1
View File
@@ -1,4 +1,3 @@
//nolint:paralleltest // global viper, as in api_test.go
package handlers_test
import (
@@ -72,6 +71,8 @@ func numericBody(
}
func TestUserhost(t *testing.T) {
t.Parallel()
tserver := newTestServer(t)
token := tserver.createSession("alice")
@@ -109,6 +110,8 @@ func TestUserhost(t *testing.T) {
}
func TestVersionAdminInfoTime(t *testing.T) {
t.Parallel()
tserver := newTestServer(t)
token := tserver.createSession("frank")
@@ -147,6 +150,8 @@ func TestVersionAdminInfoTime(t *testing.T) {
}
func TestKill(t *testing.T) {
t.Parallel()
tserver := newTestServerWithOper(t)
victimToken := tserver.createSession("victim")
@@ -213,6 +218,8 @@ func TestKill(t *testing.T) {
}
func TestWallops(t *testing.T) {
t.Parallel()
tserver := newTestServerWithOper(t)
receiverToken := tserver.createSession("receiver")
@@ -258,6 +265,8 @@ func TestWallops(t *testing.T) {
}
func TestUserMode(t *testing.T) {
t.Parallel()
const (
nick = "alice"
other = "other"