From 4d12c6913abb538a7cbd696873fcad27f9f04e82 Mon Sep 17 00:00:00 2001 From: Richard R Date: Thu, 21 May 2026 18:50:11 -0600 Subject: [PATCH] test(export): streamline export cleanup and improve test reliability Remove unnecessary UI reload and modal interactions during audiobook export cleanup to reduce flakiness under load. Set explicit timeout for long-running MP3 export test to ensure consistent execution. These changes enhance test stability and maintainability. --- tests/export.spec.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/export.spec.ts b/tests/export.spec.ts index 8d9e048..00e6153 100644 --- a/tests/export.spec.ts +++ b/tests/export.spec.ts @@ -243,11 +243,9 @@ async function resetAudiobookById(page: Page, bookId: string) { async function resetAudiobookIfPresent(page: Page, bookId?: string) { // Prefer backend reset when bookId is available: deterministic and independent of modal timing. + // Do not block on UI re-open during end-of-test cleanup, which can be flaky under load. if (bookId) { await resetAudiobookById(page, bookId); - await page.reload(); - await openExportModal(page); - await expect(page.getByRole('button', { name: 'Start Generation' })).toBeVisible({ timeout: 60_000 }); return; } @@ -273,6 +271,8 @@ async function resetAudiobookIfPresent(page: Page, bookId?: string) { } test('exports full MP3 audiobook for PDF using mocked 10s TTS sample', async ({ page }, testInfo) => { + test.setTimeout(60_000); + // Ensure TTS is mocked and app is ready await setupTest(page, testInfo);