mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-03 01:54:35 -05:00
ce9b531892
[server-ce] add test for graceful shutdown GitOrigin-RevId: 5e72e0073169009d2e3ece5a79cbd62051f6ad5b
26 lines
604 B
TypeScript
26 lines
604 B
TypeScript
import { reconfigure } from './hostAdminClient'
|
|
|
|
export const STARTUP_TIMEOUT =
|
|
parseInt(Cypress.env('STARTUP_TIMEOUT'), 10) || 120_000
|
|
|
|
let lastConfig: string
|
|
|
|
export function startWith({
|
|
pro = false,
|
|
version = 'latest',
|
|
vars = {},
|
|
varsFn = () => ({}),
|
|
withDataDir = false,
|
|
}) {
|
|
before(async function () {
|
|
Object.assign(vars, varsFn())
|
|
const cfg = JSON.stringify({ pro, version, vars, withDataDir })
|
|
if (lastConfig === cfg) return
|
|
|
|
this.timeout(STARTUP_TIMEOUT)
|
|
await reconfigure({ pro, version, vars, withDataDir })
|
|
lastConfig = cfg
|
|
})
|
|
}
|
|
|
|
export { reconfigure }
|