From 45f1221d001619ce471910c3258d508cc22bd95b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexis=20M=C3=A9taireau?= Date: Tue, 22 Oct 2024 13:16:00 +0200 Subject: [PATCH] Use fake timers on the HLC tests --- umap/static/umap/unittests/hlc.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/umap/static/umap/unittests/hlc.js b/umap/static/umap/unittests/hlc.js index 41d366b6..36da4f34 100644 --- a/umap/static/umap/unittests/hlc.js +++ b/umap/static/umap/unittests/hlc.js @@ -79,6 +79,8 @@ describe('HybridLogicalClock', () => { it('should increment nn when local and remote times are equal', () => { const now = Date.now() + // mock the clock to be the same time + sinon.useFakeTimers(now) clock = new HybridLogicalClock(now, 5, 'local') const result = clock.receive(`${now}:7:remote`) expect(result.walltime).to.be.at.least(now)