IRC listener tests fail when run again: test databases are shared between runs #129

Closed
opened 2026-10-08 10:48:16 +02:00 by clawbot · 0 comments
Collaborator

Tests in internal/ircserver fail intermittently when run again in the same process. Each test environment opens a shared-cache in-memory database named after the test (file:<name>?mode=memory&cache=shared, internal/ircserver/server_test.go), and the previous run's server can still be holding that database open, so a repeat run starts on its leftover data. Run alone 40 times back to back under -race, TestPingPong, TestPrivmsgBetweenClients, TestDirectMessage and TestIdleCleanupKeepsActiveUser failed between 2 and 18 times, always while a client was registering. With a unique database name per run, the same test passed 60 of 60. Found by the review of #126.

Definition of done

  1. Every test environment in internal/ircserver gets its own database, so no run can see another run's data.
  2. TestPingPong, TestPrivmsgBetweenClients, TestDirectMessage and TestIdleCleanupKeepsActiveUser each pass 40 back-to-back runs under -race.
  3. No test removed, skipped or weakened; -race stays.
  4. One reviewed PR against next.

Model: opus-5-5

Tests in `internal/ircserver` fail intermittently when run again in the same process. Each test environment opens a shared-cache in-memory database named after the test (`file:<name>?mode=memory&cache=shared`, `internal/ircserver/server_test.go`), and the previous run's server can still be holding that database open, so a repeat run starts on its leftover data. Run alone 40 times back to back under `-race`, `TestPingPong`, `TestPrivmsgBetweenClients`, `TestDirectMessage` and `TestIdleCleanupKeepsActiveUser` failed between 2 and 18 times, always while a client was registering. With a unique database name per run, the same test passed 60 of 60. Found by the review of https://git.eeqj.de/sneak/neoirc/pulls/126. ## Definition of done 1. Every test environment in `internal/ircserver` gets its own database, so no run can see another run's data. 2. `TestPingPong`, `TestPrivmsgBetweenClients`, `TestDirectMessage` and `TestIdleCleanupKeepsActiveUser` each pass 40 back-to-back runs under `-race`. 3. No test removed, skipped or weakened; `-race` stays. 4. One reviewed PR against `next`. Model: opus-5-5
clawbot self-assigned this 2026-10-08 10:48:16 +02:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/neoirc#129