This is an automated email from the ASF dual-hosted git repository.
choo121600 pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new 8977f9597c0 Fix flaky DagRunTab E2E test for Dag runs state filtering
(#63794)
8977f9597c0 is described below
commit 8977f9597c0149c9a209027e94921c26eb3708f5
Author: Yeonguk Choo <[email protected]>
AuthorDate: Tue Mar 17 18:59:54 2026 +0900
Fix flaky DagRunTab E2E test for Dag runs state filtering (#63794)
---
.../airflow/ui/tests/e2e/pages/DagRunsTabPage.ts | 39 +++++++++++++---------
1 file changed, 24 insertions(+), 15 deletions(-)
diff --git a/airflow-core/src/airflow/ui/tests/e2e/pages/DagRunsTabPage.ts
b/airflow-core/src/airflow/ui/tests/e2e/pages/DagRunsTabPage.ts
index 61360f923e5..cccdb394366 100644
--- a/airflow-core/src/airflow/ui/tests/e2e/pages/DagRunsTabPage.ts
+++ b/airflow-core/src/airflow/ui/tests/e2e/pages/DagRunsTabPage.ts
@@ -59,7 +59,14 @@ export class DagRunsTabPage extends BasePage {
const currentUrl = new URL(this.page.url());
currentUrl.searchParams.set("state", state.toLowerCase());
+
+ const responsePromise = this.page.waitForResponse(
+ (response) => response.url().includes("dagRuns") &&
response.request().method() === "GET",
+ { timeout: 15_000 },
+ );
+
await this.navigateTo(currentUrl.pathname + currentUrl.search);
+ await responsePromise;
await expect(this.page).toHaveURL(/.*state=.*/, { timeout: 15_000 });
await this.waitForRunsTableToLoad();
}
@@ -118,7 +125,14 @@ export class DagRunsTabPage extends BasePage {
const currentUrl = new URL(this.page.url());
currentUrl.searchParams.set("run_id_pattern", pattern);
+
+ const responsePromise = this.page.waitForResponse(
+ (response) => response.url().includes("dagRuns") &&
response.request().method() === "GET",
+ { timeout: 15_000 },
+ );
+
await this.navigateTo(currentUrl.pathname + currentUrl.search);
+ await responsePromise;
await expect(this.page).toHaveURL(/.*run_id_pattern=.*/, { timeout: 15_000
});
await this.waitForRunsTableToLoad();
}
@@ -160,16 +174,13 @@ export class DagRunsTabPage extends BasePage {
const rows = this.tableRows;
- await expect(rows).not.toHaveCount(0);
+ await expect(rows).not.toHaveCount(0, { timeout: 10_000 });
- const rowCount = await rows.count();
-
- for (let i = 0; i < Math.min(rowCount, 5); i++) {
- const stateBadge = rows.nth(i).getByTestId("state-badge");
+ const nonMatchingRows = rows.filter({
+ hasNot: this.page.getByTestId("state-badge").getByText(new
RegExp(expectedState, "i")),
+ });
- await expect(stateBadge).toBeVisible();
- await expect(stateBadge).toContainText(expectedState, { ignoreCase: true
});
- }
+ await expect(nonMatchingRows).toHaveCount(0, { timeout: 10_000 });
}
public async verifyRunDetailsDisplay(): Promise<void> {
@@ -203,15 +214,13 @@ export class DagRunsTabPage extends BasePage {
const rows = this.tableRows;
- await expect(rows).not.toHaveCount(0);
-
- const count = await rows.count();
+ await expect(rows).not.toHaveCount(0, { timeout: 10_000 });
- for (let i = 0; i < Math.min(count, 5); i++) {
- const runIdLink = rows.nth(i).getByRole("link").first();
+ const nonMatchingRows = rows.filter({
+ hasNot: this.page.getByRole("link").getByText(new RegExp(pattern, "i")),
+ });
- await expect(runIdLink).toContainText(pattern, { ignoreCase: true });
- }
+ await expect(nonMatchingRows).toHaveCount(0, { timeout: 10_000 });
}
public async waitForRunsTableToLoad(): Promise<void> {