Merge pull request #12658 from overleaf/bg-node-18-upgrade

Upgrade to node 18

GitOrigin-RevId: 1b25d20a8987950a72a7bf966a825794de4ad960
This commit is contained in:
Brian Gough
2023-04-20 08:03:37 +00:00
committed by Copybot
parent df300b5f24
commit ed0acd8e58
71 changed files with 132 additions and 120 deletions
+1 -1
View File
@@ -1 +1 @@
16.17.1
18.16.0
+1 -1
View File
@@ -2,7 +2,7 @@
# Instead run bin/update_build_scripts from
# https://github.com/overleaf/internal/
FROM node:16.17.1 as base
FROM node:18.16.0 as base
WORKDIR /overleaf/services/filestore
COPY services/filestore/install_deps.sh /overleaf/services/filestore/
+1 -1
View File
@@ -4,6 +4,6 @@ filestore
--docker-repos=gcr.io/overleaf-ops
--env-add=ENABLE_CONVERSIONS="true",USE_PROM_METRICS="true",AWS_S3_USER_FILES_BUCKET_NAME=fake_user_files,AWS_S3_TEMPLATE_FILES_BUCKET_NAME=fake_template_files,AWS_S3_PUBLIC_FILES_BUCKET_NAME=fake_public_files,GCS_USER_FILES_BUCKET_NAME=fake_userfiles,GCS_TEMPLATE_FILES_BUCKET_NAME=fake_templatefiles,GCS_PUBLIC_FILES_BUCKET_NAME=fake_publicfiles
--env-pass-through=
--node-version=16.17.1
--node-version=18.16.0
--public-repo=True
--script-version=4.1.0
@@ -13,11 +13,9 @@ const streamifier = require('streamifier')
chai.use(require('chai-as-promised'))
const { ObjectId } = require('mongodb')
const tk = require('timekeeper')
const ChildProcess = require('child_process')
const fsWriteFile = promisify(fs.writeFile)
const fsStat = promisify(fs.stat)
const exec = promisify(ChildProcess.exec)
const msleep = promisify(setTimeout)
if (!process.env.AWS_ACCESS_KEY_ID) {
@@ -42,19 +40,24 @@ describe('Filestore', function () {
async function expectNoSockets() {
try {
await msleep(1000)
const { stdout } = await exec('ss -tnH')
const stdout = await fs.promises.readFile('/proc/net/tcp', 'utf8')
const badSockets = []
for (const socket of stdout.split('\n')) {
const fields = socket.split(' ').filter(part => part !== '')
if (
fields.length > 2 &&
parseInt(fields[1]) &&
!seenSockets.includes(socket)
) {
badSockets.push(socket)
seenSockets.push(socket)
const lines = stdout.split('\n').map(line => line.trim().split(/\s+/))
const header = lines.shift()
if (header[4] === 'tx_queue' && header[5] === 'rx_queue') {
for (const socket of lines) {
if (
socket.length > 5 &&
socket[4] !== '00000000:00000000' && // ensure the socket queues are empty
!seenSockets.includes(socket)
) {
console.log('socket still has data', socket)
badSockets.push(socket)
seenSockets.push(socket)
}
}
} else {
throw new Error('unexpected format in /proc/net/tcp')
}
if (badSockets.length) {