Handler and service tests can reuse a finished test's database #131

Closed
opened 2026-10-08 12:02:01 +02:00 by clawbot · 2 comments
Collaborator

internal/handlers and internal/service name each test's shared-cache in-memory database after the address of the running test. That is unique among tests running at the same time, but once a finished test is garbage-collected a later test can get the same address, and with it a database a finished test's server may still hold open: the same flaw #129 fixed in internal/ircserver. No failure has been seen from it yet. Found by the review of #130.

Definition of done

  1. Every test database in internal/handlers and internal/service gets a name no other test in the process can get (a random name, as internal/ircserver now uses, or the counter internal/db uses).
  2. No test removed, skipped or weakened; internal/handlers stays under 20 seconds as go test -race reports it in the Docker test phase.
  3. One reviewed PR against next.

Model: opus-5-5

`internal/handlers` and `internal/service` name each test's shared-cache in-memory database after the address of the running test. That is unique among tests running at the same time, but once a finished test is garbage-collected a later test can get the same address, and with it a database a finished test's server may still hold open: the same flaw https://git.eeqj.de/sneak/neoirc/issues/129 fixed in `internal/ircserver`. No failure has been seen from it yet. Found by the review of https://git.eeqj.de/sneak/neoirc/pulls/130. ## Definition of done 1. Every test database in `internal/handlers` and `internal/service` gets a name no other test in the process can get (a random name, as `internal/ircserver` now uses, or the counter `internal/db` uses). 2. No test removed, skipped or weakened; `internal/handlers` stays under 20 seconds as `go test -race` reports it in the Docker test phase. 3. One reviewed PR against `next`. Model: opus-5-5
clawbot self-assigned this 2026-10-08 12:02:01 +02:00
Author
Collaborator

Plan: one PR against next. Every test database in internal/handlers and internal/service gets a name no other test in the process can get, the same way internal/ircserver names its test databases. No test removed, skipped or weakened.

Model: opus-5-5

Plan: one PR against `next`. Every test database in `internal/handlers` and `internal/service` gets a name no other test in the process can get, the same way `internal/ircserver` names its test databases. No test removed, skipped or weakened. Model: opus-5-5
Author
Collaborator

Built in #138: each test database in internal/handlers and internal/service now gets a random name, as in internal/ircserver, and one new test per package checks that two test databases open at once do not share one.

Model: opus-5-5

Built in https://git.eeqj.de/sneak/neoirc/pulls/138: each test database in `internal/handlers` and `internal/service` now gets a random name, as in `internal/ircserver`, and one new test per package checks that two test databases open at once do not share one. Model: opus-5-5
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/neoirc#131