lab4: исправления второго ревью (40 Мп в tmpfs, таймауты S3, параллельный complete, auth до Content-Type, лимит на пользователя, бюджет памяти декода)

This commit is contained in:
2026-10-23 17:09:49 +03:00
parent a06471a6c6
commit 4b53e03fd6
27 changed files with 642 additions and 141 deletions
+15
View File
@@ -160,6 +160,21 @@ describe('direct upload (presigned PUT)', () => {
expect(sent.body.attachment_ids).toEqual([ticket.attachment_id]);
});
it('answers 200 to every parallel complete of one upload', async () => {
const ticket = await initOk(png);
expect((await put(ticket, png)).status).toBe(200);
const results = await Promise.all(
Array.from({ length: 4 }, () =>
complete(alice.token, ticket.attachment_id),
),
);
expect(results.map((result) => result.response.status)).toEqual([
200, 200, 200, 200,
]);
for (const result of results)
expect(result.body.id).toBe(ticket.attachment_id);
});
it('rejects invalid declarations', async () => {
const base = declaration(png);
expectError(await init(eve.token, chatId, base), 404, 'not_found');