openvibers/openvibe.shared Commits

metrics test: let the event-loop histogram take a sample before the scrape (the p99 line is correctly absent with no samples; CI raced it)

OP OpenVibers committed 23 Sept 2026 · f81e54b613 · 1 file, +3 −0


Changes

ddiff --git a/test/metrics.test.js b/test/metrics.test.js
iindex 655d6c7..1dbe0b8 100644
---- a/test/metrics.test.js
++++ b/test/metrics.test.js
@@@ -98,6 +98,9 @@ const metrics = require('../metrics');
await get('/boom');
await get('/sse');
await get('/nope/9999/secret-path');
++ // The event-loop histogram only reports once it has samples; on a fast CI runner the scrape
++ // could otherwise come before the first sampling interval has elapsed.
++ await new Promise((r) => setTimeout(r, 150));
const out = await get('/metrics');
assert.strictEqual(out.status, 200);
assert.match(out.type, /^text\/plain; version=0\.0\.4/);