From b2b8efff7d40dc297f85eb7a07a78a105fa0ebbe Mon Sep 17 00:00:00 2001 From: Andrew Harding Date: Wed, 30 Nov 2022 16:20:55 -0700 Subject: [PATCH] Makefile: disable postgres fsync in the test container MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This change turns off fsync on the postgres container used for tests. This reduces migration time significantly when initializing new satellite databases. The change also includes a new benchmark for satellite initialization in testplanet. $ benchstat old.txt new.txt name old time/op new time/op delta Run_Satellite/Postgres-16 1.36s ± 0% 0.08s ± 0% ~ (p=1.000 n=1+1) Change-Id: Ic954767133864770cf652b0dfdcd6b109a167b5f --- docker-compose.tests.yaml | 1 + private/testplanet/run_test.go | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/docker-compose.tests.yaml b/docker-compose.tests.yaml index 08392382b..b0e25ac28 100644 --- a/docker-compose.tests.yaml +++ b/docker-compose.tests.yaml @@ -5,6 +5,7 @@ version: "3.4" services: postgres: hostname: postgres + command: -c fsync=off image: postgres environment: POSTGRES_USER: postgres diff --git a/private/testplanet/run_test.go b/private/testplanet/run_test.go index 2309b470d..0feef0932 100644 --- a/private/testplanet/run_test.go +++ b/private/testplanet/run_test.go @@ -25,6 +25,10 @@ func TestRun(t *testing.T) { }) } +func BenchmarkRun_Satellite(b *testing.B) { + benchmarkRunConfig(b, testplanet.Config{SatelliteCount: 1}) +} + func BenchmarkRun_StorageNode(b *testing.B) { benchmarkRunConfig(b, testplanet.Config{StorageNodeCount: 4}) }