Files
Evan JarrettandClaude Fable 5.1 167e00dc4f tests: open the scan broadcaster test database the way production does, and run CI with the testmode tag
Four scan broadcaster tests failed in CI with "database is locked" on a
status query. The helper opened the scan database with a bare sql.Open,
while NewScanBroadcaster goes through holddb.OpenLocalDB. That left the
test pool with no busy_timeout on any connection and the file in
rollback-journal mode, so a test polling a job's status every 2ms on one
pooled connection raced the storage goroutine's commit on another, and a
read that landed inside the commit failed immediately instead of waiting.
The window is sub-millisecond on a local disk and reproduced only under
fsync-heavy load here, but the CI runner's disk hits it regularly.

Both hand-opened scan databases now go through OpenLocalDB. Under the
same disk load, 120 runs of the four tests pass where one in sixty failed
before.

The CI workflow also now passes -tags testmode, matching make test.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GPiKVQcxGYwxAbGnZv2tir
2026-09-14 09:14:12 -05:00

24 lines
438 B
YAML

when:
- event: ["push"]
branch: ["*"]
- event: ["pull_request"]
branch: ["main"]
engine: kubernetes
image: mirror.gcr.io/library/golang:1.26.7-trixie
architecture: amd64
steps:
- name: Download and Generate
environment:
CGO_ENABLED: 1
command: |
go mod download
go generate ./...
- name: Run Tests
environment:
CGO_ENABLED: 1
command: |
go test -tags testmode -cover ./...