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.
Changes
@@@ -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();});
@@ -90,9 +90,10 @@ const { boot, check, done } = require('./helpers/app');
@@ -90,9 +90,10 @@ const { boot, check, done } = require('./helpers/app');
assert.ok(d1 > 100 && d1 <= 200 + 60, `capped to <=200 (was ${d1})`);
assert.ok(d1 > 100 && d1 <= 200 + 60, `capped to <=200 (was ${d1})`);
dev.send({ type: 'ack', id: c1.id });
dev.send({ type: 'ack', id: c1.id });
await op.waitFor((m) => m.type === 'command_result' && m.id === 'd1');
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 });
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');
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 });
dev.send({ type: 'ack', id: c2.id });
op.close(); dev.close();
op.close(); dev.close();
});
});