Skip to content

Commit a2b11a5

Browse files
committed
ci(sync-service): add oracle property test job with server restarts
1 parent 0e25699 commit a2b11a5

2 files changed

Lines changed: 61 additions & 1 deletion

File tree

.github/workflows/sync_service_tests.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,55 @@ jobs:
169169

170170
- *upload_test_results_to_codecov
171171

172+
oracle_property_test_with_restarts:
173+
name: 'Oracle property test with restarts (${{ matrix.restart_type }})'
174+
runs-on: blacksmith-4vcpu-ubuntu-2404
175+
defaults:
176+
run:
177+
working-directory: packages/sync-service
178+
strategy:
179+
fail-fast: false
180+
matrix:
181+
restart_type: [graceful, brutal]
182+
env:
183+
MIX_ENV: test
184+
MIX_TARGET: application
185+
POSTGRES_VERSION: '170000'
186+
CODECOV_FLAGS: elixir,oracle-tests,sync-service,postgres-170000
187+
CODECOV_TEST_RESULTS_FILES: ./junit/regular-test-junit-report.xml
188+
CHECK_TIMEOUT: 60000
189+
SHAPE_COUNT: 200
190+
MUTATIONS_PER_TXN: 10
191+
TXNS_PER_BATCH: 10
192+
BATCH_COUNT: 50
193+
SKIP_REPATCH_PREWARM: 'true'
194+
RESTART_SERVER_EVERY: 3
195+
RESTART_TYPE: ${{ matrix.restart_type }}
196+
TEST_POOL_SIZE: 20
197+
services:
198+
postgres:
199+
image: 'ghcr.io/${{ github.repository }}/postgres:17-alpine-logical'
200+
env:
201+
POSTGRES_PASSWORD: password
202+
options: *postgres_health_check
203+
ports:
204+
- 54321:5432
205+
206+
pgbouncer: *pgbouncer_service
207+
steps:
208+
- *checkout_source
209+
- *seed_database
210+
- *setup_beam
211+
- *cache_dependencies
212+
- *cache_compiled_code
213+
- *install_dependencies
214+
- *compile_package
215+
216+
- name: Run oracle property test with ${{ matrix.restart_type }} server restarts
217+
run: mix test --only oracle test/integration/oracle_property_test.exs
218+
219+
- *upload_test_results_to_codecov
220+
172221
performance_test:
173222
name: 'Performance test, pg17'
174223
runs-on: blacksmith-4vcpu-ubuntu-2404

packages/sync-service/test/support/component_setup.ex

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,13 @@ defmodule Support.ComponentSetup do
419419
[on_cleanup: on_cleanup]
420420
end
421421

422+
defp env_pool_size do
423+
case System.get_env("TEST_POOL_SIZE") do
424+
nil -> 2
425+
value -> String.to_integer(value)
426+
end
427+
end
428+
422429
def with_complete_stack(ctx) do
423430
stack_id = full_test_name(ctx)
424431

@@ -731,7 +738,11 @@ defmodule Support.ComponentSetup do
731738
pool_opts: [
732739
backoff_type: :stop,
733740
max_restarts: 0,
734-
pool_size: 2
741+
# Default of 2 leaves a snapshot pool of 1 connection
742+
# (Connection.Manager.pool_sizes/1), which under many-shape loads
743+
# (e.g. the oracle property test) starves move-in queries into
744+
# queue timeouts and 409 load-shedding. Override for such tests.
745+
pool_size: Map.get(ctx, :db_pool_size, env_pool_size())
735746
],
736747
tweaks: [
737748
registry_partitions: 1,

0 commit comments

Comments
 (0)