openvibers/openvibe.media Commits
finish-f2: Changed: the server-boot wait in test/perf-budget.test.js…
Changes
@@@ -40,7 +40,7 @@ const { measure, check, format } = require('openvibe-shared/perf-budget');const base = `http://127.0.0.1:${port}`;try {let up = false;-- for (let i = 0; i < 150 && !up; i++) {++ for (let i = 0; i < 600 && !up; i++) { // 60 s: a cold PGlite boot plus migrations is slow on a loaded machineup = await fetch(`${base}/healthz`).then((r) => r.ok).catch(() => false);if (!up) await new Promise((r) => setTimeout(r, 100));}@@@ -65,8 +65,9 @@ const express = require('express');child.stdout.on('data', (d) => { log += d; });child.stderr.on('data', (d) => { log += d; });let up = false;-- for (let i = 0; i < 100 && !up; i++) {-- try { up = (await get('127.0.0.1', freePort, '/healthz')).status === 200; } catch { await new Promise((res) => setTimeout(res, 100)); }++ for (let i = 0; i < 600 && !up; i++) { // 60 s: a cold PGlite boot plus migrations is slow on a loaded machine++ try { up = (await get('127.0.0.1', freePort, '/healthz')).status === 200; } catch { /* not listening yet */ }++ if (!up) await new Promise((res) => setTimeout(res, 100));}assert.ok(up, `the server booted: ${log.slice(-500)}`);// /metrics answers loopback callers only and refuses anything that came through a proxy; with
@@ -40,7 +40,7 @@ const { measure, check, format } = require('openvibe-shared/perf-budget');
@@ -40,7 +40,7 @@ const { measure, check, format } = require('openvibe-shared/perf-budget');
const base = `http://127.0.0.1:${port}`;
const base = `http://127.0.0.1:${port}`;
try {
try {
let up = false;
let up = false;
- for (let i = 0; i < 150 && !up; i++) {
+ for (let i = 0; i < 600 && !up; i++) { // 60 s: a cold PGlite boot plus migrations is slow on a loaded machine
up = await fetch(`${base}/healthz`).then((r) => r.ok).catch(() => false);
up = await fetch(`${base}/healthz`).then((r) => r.ok).catch(() => false);
if (!up) await new Promise((r) => setTimeout(r, 100));
if (!up) await new Promise((r) => setTimeout(r, 100));
}
}
@@ -65,8 +65,9 @@ const express = require('express');
@@ -65,8 +65,9 @@ const express = require('express');
child.stdout.on('data', (d) => { log += d; });
child.stdout.on('data', (d) => { log += d; });
child.stderr.on('data', (d) => { log += d; });
child.stderr.on('data', (d) => { log += d; });
let up = false;
let up = false;
- for (let i = 0; i < 100 && !up; i++) {
- try { up = (await get('127.0.0.1', freePort, '/healthz')).status === 200; } catch { await new Promise((res) => setTimeout(res, 100)); }
+ for (let i = 0; i < 600 && !up; i++) { // 60 s: a cold PGlite boot plus migrations is slow on a loaded machine
+ try { up = (await get('127.0.0.1', freePort, '/healthz')).status === 200; } catch { /* not listening yet */ }
+ if (!up) await new Promise((res) => setTimeout(res, 100));
}
}
assert.ok(up, `the server booted: ${log.slice(-500)}`);
assert.ok(up, `the server booted: ${log.slice(-500)}`);
// /metrics answers loopback callers only and refuses anything that came through a proxy; with
// /metrics answers loopback callers only and refuses anything that came through a proxy; with