Skip to content

Share one MongoDB container across the datastore tests - #96

Merged
paskal merged 1 commit into
masterfrom
fix/datastore-shared-mongo-container
Nov 1, 2026
Merged

paskal merged 1 commit into
masterfrom
fix/datastore-shared-mongo-container

Conversation

@paskal

@paskal paskal commented Nov 1, 2026

Copy link
Copy Markdown
Member

Previously, the datastore tests repeatedly started MongoDB containers. The package took 20-30s on a healthy runner, and the build job on master (Bump golang.org/x/net) failed when a slow runner pushed it past the 60s go test timeout.

After this change, TestMain starts one container for the package, and tests that access stored data use separate databases for isolation. The package now runs in about 3s locally. No production code changes.

Verified with go test -timeout=60s -race ./... and golangci-lint run.

Datastore tests repeatedly started MongoDB containers, taking 20-30s on a
healthy runner and exceeding the 60s test timeout on a slow one. Start one
container in TestMain and use separate databases to isolate test data.
@paskal
paskal merged commit 19e281b into master Nov 1, 2026
2 checks passed
@paskal
paskal deleted the fix/datastore-shared-mongo-container branch November 1, 2026 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant