Repository navigation
fix: steady the release tests and add cheap database upkeep - #42
Merged
Merged
Conversation
Fixed 300 to 500 ms sleeps raced the 200 ms ingest flush on slow CI runners and failed release runs. Tests now wait until the buffer reports the rows committed. Envelopes the handler drops before buffering (session-only, a malformed profile, profiling off) are asserted on the buffer's counters, with nothing to wait for.
COMPOSE ran docker compose version on every make call, which made the Makefile tests slow on CI runners and timed them out at bun's 5 s default. It is now deferred and kept out of the exported environment, so only the db targets call Docker. The Makefile tests get a 30 s timeout and check that migrate-create, build and lint never call Docker.
- Drop logs_attributes: no query uses a JSONB operator on attributes, and its GIN entries were a large share of log insert time and WAL - Index issues.regressed_at for the alert evaluator, which asks for recent regressions every 15 seconds - Vacuum and analyze events, event_tags, transactions, spans, logs and issues at 2% change instead of 20%, so large tables keep their visibility maps fresh
Docker's 64 MB /dev/shm default is too small for parallel queries on a large database. Both the shipped compose file and the one install.sh writes now set shm_size.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Last prep before tagging a release.
Type of change
Changes
Flaky tests
internal/ingest/txbuffer_test.go, raced the 200 ms ingest flush. They now usewaitPersisted, which waits until the buffer reports the rows committed, with a 10 s deadline.COMPOSErandocker compose versionon everymakecall. That slowed the Makefile tests on CI runners until they hit bun's 5 s default timeout. The variable is now deferred and kept out of the exported environment, so only thedb*targets call Docker.dockeron PATH to check thatmigrate-create,build,lintand a mistyped target never call it.Migration 0038 (no table rewrites; every statement can safely run again)
logs_attributes. No query uses a JSONB operator on log attributes, and its GIN entries were a large share of log insert time and WAL.issues_regressed_atfor the alert check that runs every 15 s.Compose
shm_size: 1gfor Postgres indocker-compose.ymland in the compose fileinstall.shwrites. Docker's default/dev/shmof 64 MB is too small for parallel queries.Left out on purpose: I also tried replacing the
usage_updatestatement triggers with a row trigger limited toproject_idandreceived_at, so the grouper's per-event update would never fire them. A singleUPDATEthat moves many rows then fires the row trigger once per row. Each firing updates the same counter row again in one transaction, so the cost grows quadratically; a retention test that moves 205k rows hung. The right fix for that overhead is batching the grouper.Test plan
TestMigration0038IsIdempotentre-runs the whole migration. It checks thatlogs_attributesis gone andissues_regressed_atexists, that the planner uses the new index forregressed_at > $1, and that the autovacuum settings are on all six tables.make -n db db-stop db-logsstill prints the compose commands.shm_size, anddocker compose configaccepts the file.go vet, golangci-lint (0 issues),go test -race ./...(all 17 packages) and the four bun script test files (11 tests) pass.Checklist
Contributor License Agreement