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)
This commit is contained in:
Christian Decker
2020-08-26 10:31:22 +02:00
committed by Rusty Russell
parent 0923215834
commit d46d82eeff

View File

@@ -141,7 +141,8 @@ class PostgresDbProvider(object):
def start(self): def start(self):
passfile = os.path.join(self.directory, "pgpass.txt") passfile = os.path.join(self.directory, "pgpass.txt")
self.pgdir = os.path.join(self.directory, 'pgsql') 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: with open(passfile, 'w') as f:
f.write('cltest\n') f.write('cltest\n')
@@ -153,6 +154,10 @@ class PostgresDbProvider(object):
'--auth=trust', '--auth=trust',
'--username=postgres', '--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.port = reserve()
self.proc = subprocess.Popen([ self.proc = subprocess.Popen([
postgres, postgres,