Skip to content

Add shared test fixtures and API-based data isolation#64202

Open
choo121600 wants to merge 1 commit intoapache:mainfrom
choo121600:refactor/e2e-test-infra
Open

Add shared test fixtures and API-based data isolation#64202
choo121600 wants to merge 1 commit intoapache:mainfrom
choo121600:refactor/e2e-test-infra

Conversation

@choo121600
Copy link
Member

@choo121600 choo121600 commented Mar 25, 2026

Summary

Introduce a layered Playwright fixture system to replace fragile beforeAll browser-based setup, enabling reliable data isolation and deterministic cleanup.

This change lays the foundation for safe parallel E2E execution.

Why

E2E tests have been intermittently failing in CI, causing unreliable builds and frequent reruns, due to two root causes:

  • UI-based data setup in beforeAll
    • Tests created seed data by opening a browser and clicking through the UI. This made setup fragile: dialog animations, rendering delays, and element timing issues could cause the setup itself to fail before any assertions ran.
  • Insufficient data isolation between parallel workers
    • Test identifiers were generated with Date.now(), which can collide when multiple Playwright workers start at the same time. Leftover data from previous runs could also interfere with assertions that assumed exact row counts.

Core fixtures

  • Add fixtures/pom.ts — POM fixtures with worker-scoped authenticatedRequest
  • Add fixtures/data.ts — worker-scoped data fixtures (dagReady, successDagRun, executedDagRun, successAndFailedRuns) with try/finally cleanup

*https://playwright.dev/docs/test-fixtures
*https://playwright.dev/docs/test-parallel#isolate-test-data-between-parallel-workers

Domain-specific fixtures

  • Add fixtures for asset, audit-log, calendar, dag-runs, dashboard, task-instances, and xcom

Utilities

  • Add utils/test-helpers.ts — shared API utilities with UUID-based run IDs, 409 collision recovery, and idempotent cleanup

Test infrastructure

  • Add global-teardown.ts — re-pauses DAGs after test run
  • Update playwright.config.ts — globalTeardown

*https://playwright.dev/docs/api-testing#setup-and-teardown

This structure has been fully applied in PR #64024, where tests consistently pass with improved stability.

related: #63036


Was generative AI tooling used to co-author this PR?
  • Yes (please specify the tool below)
    claude

  • Read the Pull Request Guidelines for more information. Note: commit author/co-author name and email in commits become permanently public when merged.
  • For fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
  • When adding dependency, check compliance with the ASF 3rd Party License Policy.
  • For significant user-facing changes create newsfragment: {pr_number}.significant.rst, in airflow-core/newsfragments. You can add this file in a follow-up commit after the PR is created so you know the PR number.

@boring-cyborg boring-cyborg bot added the area:UI Related to UI/UX. For Frontend Developers. label Mar 25, 2026
@choo121600 choo121600 force-pushed the refactor/e2e-test-infra branch 2 times, most recently from 6e0a3f5 to 9f82933 Compare March 25, 2026 06:33
@choo121600 choo121600 force-pushed the refactor/e2e-test-infra branch from 9f82933 to bd4bf62 Compare March 25, 2026 07:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:UI Related to UI/UX. For Frontend Developers.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant