ci: back postgres test data dir with tmpfs to avoid test timeout#765
Merged
Merged
Conversation
Member
|
Hah! The psql tests finished well before the sqlite tests this time 😄 edit: Actually time is about the same. This is great! |
gabriel-samfira
approved these changes
Jun 4, 2026
Member
|
thanks! |
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.
What
Mount the PostgreSQL service container's data directory (
/var/lib/postgresql/data) ontmpfsin theGo Tests (PostgreSQL)job.Why
The
Go Tests (PostgreSQL)job has been hitting thego testtimeout and failing, unrelated to the PR under test:The
database/sqlsuite creates a fresh schema and runs the full migration for every test case (OpenTestPostgresDB->CREATE SCHEMA->migrateDB). On the defaultpostgres:16service container that DDL is fsync'd to disk, and the goroutine dump confirms the suite was stuck server-side inCreateTableon IO wait.GitHub Actions service containers can't pass server flags like
postgres -c fsync=off(there's nocommandfield), so the data directory is moved totmpfsinstead. This keeps all of Postgres's I/O in RAM, making fsync effectively free. The database is ephemeral and recreated for every job, so trading durability for speed has no downside here, and it mirrors thefsync=offconfig already used for local Postgres test runs.Measured locally on the
database/sqlpackage with the same flags CI uses (-race -parallel=4): ~562s disk-backed vs ~60s on tmpfs (~9x faster), tests still passing.