mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-11-25 14:17:31 +00:00
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:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user