Merge pull request #12853 from overleaf/jpa-tweak-filestore-test-output

[filestore] add ss header to error output when sockets are leaking

GitOrigin-RevId: 9aa61c99eaf74a061ea0b524c236abbc6f1c9846
This commit is contained in:
Jakob Ackermann 2023-04-28 13:54:51 +01:00 committed by Copybot
parent e0d9069131
commit cb16efdc53

View file

@ -42,10 +42,12 @@ describe('Filestore', function () {
async function expectNoSockets() {
try {
await msleep(1000)
const { stdout } = await exec('ss -tnH')
const { stdout } = await exec('ss -tn')
const lines = stdout.split('\n')
const header = lines.shift()
const badSockets = []
for (const socket of stdout.split('\n')) {
for (const socket of lines) {
const fields = socket.split(' ').filter(part => part !== '')
if (
fields.length > 2 &&
@ -62,6 +64,7 @@ describe('Filestore', function () {
console.error(
'ERR: Sockets still have receive buffer after connection closed'
)
console.error(header)
for (const socket of badSockets) {
// eslint-disable-next-line no-console
console.error(socket)