Skip to content

Commit 5c82084

Browse files
elpransJames William Pye
authored andcommitted
Always use local directory for sockets in tests
This makes it possible to run tests on systems where the default Postgres socket directory is writable only by postgres user.
1 parent 3d02a04 commit 5c82084

3 files changed

Lines changed: 3 additions & 1 deletion

File tree

postgresql/temporal.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ def init(self,
132132
log_destination = 'stderr',
133133
log_min_messages = 'FATAL',
134134
silent_mode = 'off',
135+
unix_socket_directory = cluster.data_directory,
135136
))
136137
cluster.settings.update(dict(
137138
max_prepared_transactions = '10',

postgresql/test/test_cluster.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ def init(self, *args, **kw):
3434
'listen_addresses' : 'localhost',
3535
'port' : '6543',
3636
'silent_mode' : 'off',
37+
'unix_socket_directory' : self.cluster.data_directory,
3738
})
3839

3940
def testSilentMode(self):

postgresql/test/test_connect.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ def configure_cluster(self):
8787
log_destination = 'stderr',
8888
log_min_messages = 'FATAL',
8989
silent_mode = 'off',
90+
unix_socket_directory = self.cluster.data_directory,
9091
))
9192
# 8.4 turns prepared transactions off by default.
9293
if self.cluster.installation.version_info >= (8,1):
@@ -157,7 +158,6 @@ def configure_cluster(self):
157158
super().configure_cluster()
158159
self.cluster.settings.update({
159160
'log_min_messages' : 'log',
160-
'unix_socket_directory' : self.cluster.data_directory,
161161
})
162162

163163
# Configure the hba file with the supported methods.

0 commit comments

Comments
 (0)