Repository navigation
Report per-test durations from Go unit test shards - #20703
Merged
Merged
Conversation
…edundant fixtures Since the SQLite removal, every testutil.Postgres fixture provisions a full canonical store (~360 daily partitions, ~5s), pushing internal/server past the 10m go test timeout. Provision one template database per test process through the production store and clone it per test (CREATE DATABASE ... TEMPLATE), falling back to a private schema when the role cannot create databases. Reclaim databases left by exited processes. Also share one app across TestSessionArchiveResponseClosesReader subtests and stop re-executing repository queries already covered by the full dashboard corpus test. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The storage shard timeout log showed only the test running at the 10m deadline, not which tests consumed the budget. Run Go unit tests with -v so every shard log records per-test durations and the next slow shard can be attributed directly. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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.
The "Go unit tests (storage, shard 1)" check times out at 10m in
server/internal/postgresx(PR run 43257290598, and also on main in run 43253800690). The panic log named only the test that was running at the deadline,TestWorkflowValueCollectionSnapshotPermutationConvergence. It did not show which tests had used up the shard's time budget, which made the timeout hard to attribute.Changes
.github/workflows/cgo.yml: the Go unit test step now runsgo testwith-vfor both sharded and unsharded areas, so every shard log records how long each test took.tests/unit/cao-go-ci-plan.test.mjs: the mockedgoargument positions are updated for the extra flag.Root cause and relationship to #20695
The timeout comes from per-test fixture provisioning: each test built about 360 daily partitions, costing about 5s. That is fixed by 81844a3 (template-database clones), which this branch is rebased onto and which is also in #20695. With that commit, the full
internal/postgresxpackage takes 352s locally, about 90s per storage shard. Review this PR after #20695, or merge it alongside.Notes for reviewers
TestAuditCurationSharedFixture,TestOversizedStatisticalInputIsCappedBeforePublication,TestWorkflowValueCollectionSnapshotPermutationConvergence, andTestPersistedStatisticalBundles. Their time goes to the productionPublishcall, about 0.7s each.pg_stat_statementsshows thatPublishspends more time planning queries (11.4s) than executing them (8.9s) over a 42-publish run, because many statements touch every daily partition.out of shared memoryunder the defaultmax_locks_per_transaction=64, so I reverted that attempt. This should be handled as a separate productionPublishissue.Validation
internal/postgresxrun against PostgreSQL 16: 209 tests pass in 352s.node --test tests/unit/cao-go-ci-plan.test.mjs tests/unit/workflow-contract-ci-triggers.test.mjs: 27/27 pass, run with bash 5. The CI step usesmapfile, which macOS's bundled bash 3.2 lacks.