From 035daf675f29a447cd16ad6c23e6e6747c6e5728 Mon Sep 17 00:00:00 2001 From: Simon Hornby Date: Fri, 10 Mar 2023 09:58:43 +0200 Subject: [PATCH] =?UTF-8?q?makes=20the=20'Should=20update=20last=20seen=20?= =?UTF-8?q?for=20known=20toggles=20test'=20no=20longer=20=E2=80=A6=20(#329?= =?UTF-8?q?3)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The patched test is currently depending on runtime to take more than a millisecond to update the tested property. That's not always true and more so on a fast machine, which makes this test flakey. This forces the old timestamp to be 100 ms in the past so that the checked property must be at least 100 ms different if the update occurred --- src/test/e2e/services/last-seen-service.e2e.test.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test/e2e/services/last-seen-service.e2e.test.ts b/src/test/e2e/services/last-seen-service.e2e.test.ts index b0931039dc..c00f05d2a9 100644 --- a/src/test/e2e/services/last-seen-service.e2e.test.ts +++ b/src/test/e2e/services/last-seen-service.e2e.test.ts @@ -22,7 +22,7 @@ afterAll(async () => { test('Should update last seen for known toggles', async () => { const service = new LastSeenService(stores, config); - const time = Date.now(); + const time = Date.now() - 100; await stores.featureToggleStore.create('default', { name: 'ta1' }); const metrics: IClientMetricsEnv[] = [