From d9d901e52d0001c0c4b8d02d6cec173e5bfba7dd Mon Sep 17 00:00:00 2001 From: Maurice Date: Wed, 25 Nov 2026 10:37:46 +0100 Subject: [PATCH] fix(ci): lower the client non-null baseline and arm the wait before PMEDIA-006 advances Client lint was red because the day plan change took 13 non-null assertions out of DayPlanSidebar: the count is 354 now, so the baseline goes down to it. Server tests 6/10 timed out in PMEDIA-006. The test advanced the fake clock right after asking for the rendition, but the wait it meant to run out is only armed once the copy has started; on a slow runner the clock moved past a timer that did not exist yet and the test hung for 15 seconds. It now waits for the copy to start first, as PMEDIA-006b already does. --- client/scripts/eslint-baseline.json | 2 +- .../tests/unit/nest/memories/public-media.service.test.ts | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/client/scripts/eslint-baseline.json b/client/scripts/eslint-baseline.json index f47ce22ec..e4d70fd48 100644 --- a/client/scripts/eslint-baseline.json +++ b/client/scripts/eslint-baseline.json @@ -1,6 +1,6 @@ { "src": { - "@typescript-eslint/no-non-null-assertion": 367, + "@typescript-eslint/no-non-null-assertion": 354, "@typescript-eslint/no-misused-promises": 820, "no-console": 88, "complexity": 216, diff --git a/server/tests/unit/nest/memories/public-media.service.test.ts b/server/tests/unit/nest/memories/public-media.service.test.ts index e552b48f1..94ae8f5a9 100644 --- a/server/tests/unit/nest/memories/public-media.service.test.ts +++ b/server/tests/unit/nest/memories/public-media.service.test.ts @@ -118,14 +118,20 @@ describe('renditionFor', () => { it('PMEDIA-006: a copy that takes longer than a request waits is refused as pending and finished for the next one', async () => { write('journey', 'long.jpg', phonePhoto()); let release = () => {}; + let started = () => {}; const held = new Promise((resolve) => (release = resolve)); + const building = new Promise((resolve) => (started = resolve)); storage.withLocalFile.mockImplementationOnce(async (category, name, fn) => { + started(); await held; return fn(at(category, name)); }); vi.useFakeTimers({ toFake: ['setTimeout', 'clearTimeout'] }); try { const first = expect(service.renditionFor('journey', 'long.jpg')).rejects.toBeInstanceOf(RenditionPendingError); + // Only once the copy has started is its wait armed; advancing before that + // skipped past a timer that did not exist yet, and the test hung on a slow runner. + await building; await vi.advanceTimersByTimeAsync(50_000); await first; } finally {