From d46d82eeff97ff5115fa1260be067ccbe26d11d3 Mon Sep 17 00:00:00 2001 From: Christian Decker Date: Wed, 26 Aug 2020 10:31:22 +0200 Subject: [PATCH] pyln-testing: Allow up to 1000 connections to postgresql in tests This was causing some errors when testing with a lot of parallelism (30+ tests in parallel) --- contrib/pyln-testing/pyln/testing/db.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/contrib/pyln-testing/pyln/testing/db.py b/contrib/pyln-testing/pyln/testing/db.py index bb153221d..6184f969c 100644 --- a/contrib/pyln-testing/pyln/testing/db.py +++ b/contrib/pyln-testing/pyln/testing/db.py @@ -141,7 +141,8 @@ class PostgresDbProvider(object): def start(self): passfile = os.path.join(self.directory, "pgpass.txt") self.pgdir = os.path.join(self.directory, 'pgsql') - # Need to write a tiny file containing the password so `initdb` can pick it up + # Need to write a tiny file containing the password so `initdb` can + # pick it up with open(passfile, 'w') as f: f.write('cltest\n') @@ -153,6 +154,10 @@ class PostgresDbProvider(object): '--auth=trust', '--username=postgres', ]) + conffile = os.path.join(self.pgdir, 'postgresql.conf') + with open(conffile, 'a') as f: + f.write('max_connections = 1000\nshared_buffers = 240MB\n') + self.port = reserve() self.proc = subprocess.Popen([ postgres,