Skip to content

Test performance v2 - #2

Merged
ossko merged 7 commits into
mainfrom
test-performance-v2
Sep 2, 2026
Merged

Test performance v2#2
ossko merged 7 commits into
mainfrom
test-performance-v2

Conversation

@ossko

@ossko ossko commented Sep 2, 2026

Copy link
Copy Markdown
Owner

No description provided.

ossko and others added 7 commits September 2, 2026 06:56
… cleanup

Each test process now creates its own Postgres database (colonies_test_<pid>),
so test packages no longer interfere with each other. The schema is created
once per process and prefix; subsequent PrepareTests calls truncate all tables
instead of dropping and recreating the schema, which is roughly an order of
magnitude faster. Stale databases from finished or crashed runs are dropped
opportunistically.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…arallel

Add utils.FreePorts, which asks the kernel for free ports, and use it in all
server, controller, channel, and cluster test setups instead of the fixed
TESTPORT and etcd/relay ports. Replace the shared /tmp/colonies directory with
t.TempDir. Remove the now unused TESTPORT constant.

Also poll WaitForProcessGraphs at 50 ms with a deadline instead of sleeping
one second per attempt, and shorten an event-drain sleep in the realtime
handler tests.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Config.Equals compared the matched-node counter against len(config.Nodes)
twice, so the second operand never checked the other config's node count.
Compare against len(config2.Nodes) as intended. Also flagged by go vet on
newer Go toolchains.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Replace the 41 serial per-package go test lines in the Makefile with one
go test -race ./... run. Packages now run in parallel, which the
per-process databases and dynamic ports make safe. The CI coverage run
drops -p 1. github_test stays as an alias for CI.

Constrain the wasm crypto library to js/wasm builds and delete the stale
tests/smoke program, which no longer compiles; both otherwise break the
single go test ./... invocation. tests/smoke was not built by the old
per-package Makefile.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The mock implemented the Controller interface but was never referenced by
any test; the controller tests use createTestColoniesController and the
DatabaseMock in the same file.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@ossko
ossko marked this pull request as ready for review September 2, 2026 08:22
@ossko
ossko merged commit 7ab1dcf into main Sep 2, 2026
1 check failed
@ossko
ossko deleted the test-performance-v2 branch September 2, 2026 08:28
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