]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
Revert "[Test] Fix race in history reset e2e test"
authorVsevolod Stakhov <vsevolod@rspamd.com>
Wed, 22 Jul 2026 09:09:55 +0000 (10:09 +0100)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Wed, 22 Jul 2026 09:09:55 +0000 (10:09 +0100)
This reverts commit 8d934a9790956fd21b89532e5ecfe2e00115285c.

test/playwright/tests/scan.spec.mjs

index 425710d8a79d8b81ac7f5203c8c1381403419885..47a1b4e99b73e11bec4660c58f1fa660c20201dd 100644 (file)
@@ -175,23 +175,18 @@ test.describe.serial("Scan flow across WebUI tabs", () => {
             // Reset history
             const resetBtn = page.locator("#resetHistory");
             await expect(resetBtn).toBeVisible();
+            page.once("dialog", (dialog) => dialog.accept());
+            await resetBtn.click();
 
             // The reload disables #updateHistory only for the duration of the
             // fast, local history request, which is too brief to assert on the
             // DOM. Wait for the reset and the subsequent reload responses instead.
-            // Register the waits before clicking: on localhost the responses can
-            // arrive before a listener registered after the click would see them.
-            const resetResponse = page.waitForResponse((r) => r.url().includes("historyreset"), {timeout: 10000});
-            const reloadResponse = page.waitForResponse(
+            await page.waitForResponse((r) => r.url().includes("historyreset"), {timeout: 10000});
+            await page.waitForResponse(
                 (r) => r.url().includes("history") && r.url().includes("from="),
                 {timeout: 10000}
             );
 
-            page.once("dialog", (dialog) => dialog.accept());
-            await resetBtn.click();
-            await resetResponse;
-            await reloadResponse;
-
             const updateHistoryBtn = page.locator("#updateHistory");
             await expect(updateHistoryBtn).toBeEnabled();