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.
This commit is contained in:
Maurice
2026-11-25 10:37:46 +01:00
parent 50cb9364f6
commit d9d901e52d
2 changed files with 7 additions and 1 deletions
+1 -1
View File
@@ -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,
@@ -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<void>((resolve) => (release = resolve));
const building = new Promise<void>((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 {