openvibers/openvibe.bot Commits

Device test: measure d2's deadline from its own send, not d1's. The shared timestamp folded d1's whole round trip into d2's 60 ms margin, which the Postgres store exceeds; npm test and test:pg 5/5.

OP OpenVibers committed 1 Oct 2026 · 49fbd9e519 · 1 file, +2 −1


Changes

ddiff --git a/test/device.test.js b/test/device.test.js
iindex 30d3ab7..088477b 100644
---- a/test/device.test.js
++++ b/test/device.test.js
@@@ -90,9 +90,10 @@ const { boot, check, done } = require('./helpers/app');
assert.ok(d1 > 100 && d1 <= 200 + 60, `capped to <=200 (was ${d1})`);
dev.send({ type: 'ack', id: c1.id });
await op.waitFor((m) => m.type === 'command_result' && m.id === 'd1');
++ const before2 = Date.now() + t.clock.offset;
op.send({ type: 'command', id: 'd2', kind: 'drive', value: { throttle: 1, steer: 0 }, ms: 100 });
const c2 = await dev.waitFor((m) => m.type === 'command' && m.ref === 'd2');
-- assert.ok(c2.deadline_ms - before <= 100 + 60, 'a shorter request is honoured');
++ assert.ok(c2.deadline_ms - before2 <= 100 + 60, `a shorter request is honoured (was ${c2.deadline_ms - before2})`);
dev.send({ type: 'ack', id: c2.id });
op.close(); dev.close();
});