Dear Adrian, dear Lucas, thanks for your reports. Maybe you can help me with the analysis as I have problems to reproduce it here locally.
As already reported in the bug log https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=863933 I think the problem is due to locale settings in the environment. The critical message is: +locale: Cannot set LC_MESSAGES to default locale: No such file or directory in test 247 (which starts a PSQL server). The problem happens when the psql server starts. It seems strange to me that this happens randomly. Regards Friedrich