Skip to content

Commit f5c6c24

Browse files
committed
ci: Fix PostgreSQL service configuration by using ALTER SYSTEM commands instead of options
1 parent 37403f2 commit f5c6c24

File tree

1 file changed

+12
-7
lines changed

1 file changed

+12
-7
lines changed

.github/workflows/ci.yml

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -164,13 +164,6 @@ jobs:
164164
--health-interval 10s
165165
--health-timeout 5s
166166
--health-retries 5
167-
-c fsync=off
168-
-c wal_level=minimal
169-
-c full_page_writes=off
170-
-c checkpoint_timeout=10min
171-
-c shared_buffers=256MB
172-
-c synchronous_commit=off
173-
-c max_wal_senders=0
174167
ports:
175168
- 5432:5432
176169

@@ -196,6 +189,18 @@ jobs:
196189
# This ensures psql version matches PostgreSQL server for snapshot tests
197190
- run: sudo /usr/share/postgresql-common/pgdg/apt.postgresql.org.sh -v ${POSTGRES_VERSION} -i -p
198191

192+
# Apply PostgreSQL performance optimizations for test speed
193+
# WARNING: These settings sacrifice data durability for speed - test environments only!
194+
- run: |
195+
PGPASSWORD=postgres psql -h localhost -U postgres -d postgres -c "ALTER SYSTEM SET fsync = off;"
196+
PGPASSWORD=postgres psql -h localhost -U postgres -d postgres -c "ALTER SYSTEM SET wal_level = minimal;"
197+
PGPASSWORD=postgres psql -h localhost -U postgres -d postgres -c "ALTER SYSTEM SET full_page_writes = off;"
198+
PGPASSWORD=postgres psql -h localhost -U postgres -d postgres -c "ALTER SYSTEM SET checkpoint_timeout = '10min';"
199+
PGPASSWORD=postgres psql -h localhost -U postgres -d postgres -c "ALTER SYSTEM SET shared_buffers = '256MB';"
200+
PGPASSWORD=postgres psql -h localhost -U postgres -d postgres -c "ALTER SYSTEM SET synchronous_commit = off;"
201+
PGPASSWORD=postgres psql -h localhost -U postgres -d postgres -c "ALTER SYSTEM SET max_wal_senders = 0;"
202+
PGPASSWORD=postgres psql -h localhost -U postgres -d postgres -c "SELECT pg_reload_conf();"
203+
199204
- run: cargo build --tests --workspace
200205
- run: cargo test --workspace
201206

0 commit comments

Comments
 (0)