forked from mtusi2026/mtusi2026lab4
lab4: исправления второго ревью (40 Мп в tmpfs, таймауты S3, параллельный complete, auth до Content-Type, лимит на пользователя, бюджет памяти декода)
This commit is contained in:
@@ -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');
|
||||
|
||||
Reference in New Issue
Block a user