Skip to content

Conversation

@KyeongJooni
Copy link
Contributor

@KyeongJooni KyeongJooni commented Dec 23, 2025

Add UI E2E tests for backfill pause, resume, and cancel controls

This PR adds end-to-end tests to verify the backfill control functionality on the DAG detail page.

What this tests:

  • Pausing a running backfill and verifying status changes to paused
  • Resuming a paused backfill and verifying status returns to running
  • Cancelling an active backfill and verifying status changes to cancelled
  • Verifying that cancelled backfills cannot be resumed

Implementation:

  • Created BackfillPage page object following existing POM pattern
  • Added test suite backfill-controls.spec.ts with 3 test cases
  • All tests follow the same structure as existing E2E tests (dags-list.spec.ts)

closes: #59594

  • While syncing/rebasing with upstream main on the previous PR, the diff unintentionally included files I didn’t intend to modify, which in turn triggered CODEOWNERS review requests broadly. To reduce noise and reviewer burden, I closed the original PR and opened this one with a cleaned-up, focused set of changes.

^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named {pr_number}.significant.rst or {issue_number}.significant.rst, in airflow-core/newsfragments.

@boring-cyborg boring-cyborg bot added the area:UI Related to UI/UX. For Frontend Developers. label Dec 23, 2025
@KyeongJooni KyeongJooni changed the title Feat: add E2E tests for backfill pause and stop controls Add E2E tests for backfill pause and stop controls Dec 23, 2025
@choo121600
Copy link
Member

choo121600 commented Dec 23, 2025

Thanks for PR :)
As I mentioned in the previous PR(#59705), It seems that the tests are failing.
Could you let me know if the tests passed when you ran them locally.

@KyeongJooni
Copy link
Contributor Author

Thanks for the review! I've updated the locators to scope them within the dialog context.

I attempted to run the tests locally to verify the changes. The dialog scoping follows the same pattern used in DagsPage and ensures locators only match elements within the trigger dialog, preventing the strict mode violations.

The key changes:

  • All form elements (backfillRadio, fromDateInput, toDateInput, runButton) are now scoped to dialog.locator() instead of page.locator()
  • This prevents conflicts with any duplicate elements that might exist elsewhere on the page

Let me know if you'd like me to make any additional changes!

@choo121600
Copy link
Member

On my side, the tests seem to be failing.
Could you confirm whether they passed locally?
If you could also share the logs, it would be helpful for us to debug this together😉

@vatsrahul1001
Copy link
Contributor

@KyeongJooni can we look at failure tests?

@vatsrahul1001
Copy link
Contributor

@KyeongJooni you need a rebase

@KyeongJooni KyeongJooni force-pushed the e2e/backfill-controls branch from b76840f to 84981dc Compare January 5, 2026 13:10
@KyeongJooni
Copy link
Contributor Author

KyeongJooni commented Jan 5, 2026

@KyeongJooni you need a rebase

@vatsrahul1001 Rebased on latest main as requested.

I've attempted to fix the test failures:

  • Replaced waitForPageLoad() with page.waitForLoadState()
  • Added status verification using getBackfillStatus()
  • Updated to align with upstream API changes

Could you please check if the tests pass now? Let me know if there are any remaining issues.

@KyeongJooni KyeongJooni force-pushed the e2e/backfill-controls branch from 7ee4110 to ddf22b0 Compare January 6, 2026 05:51
@KyeongJooni KyeongJooni force-pushed the e2e/backfill-controls branch 4 times, most recently from 054eb92 to ef55450 Compare January 7, 2026 13:49
KyeongJooni and others added 9 commits January 10, 2026 23:18
Rebased on upstream/main to resolve conflicts and fix test failures.

- fix: use page.waitForLoadState() instead of waitForPageLoad()
- feat: add status verification with getBackfillStatus()
- refactor: update to new createBackfill(dagName, options) API
- refactor: apply global auth pattern from PR apache#59692
- refactor: use dynamic dates instead of hardcoded values

Closes apache#59594
Avoid waitForNoActiveBackfill() timeout by testing controls on
actively running backfills instead of waiting for completion.
Add AUTH_FILE import and align with backfill.spec.ts patterns.
- Use beforeEach/afterEach pattern with serial mode
- Replace waitForTimeout with explicit state waits
- Remove unused helper methods
- Update test structure and naming conventions
Co-authored-by: Rahul Vats <43964496+vatsrahul1001@users.noreply.github.com>
Co-authored-by: Rahul Vats <43964496+vatsrahul1001@users.noreply.github.com>
@KyeongJooni KyeongJooni force-pushed the e2e/backfill-controls branch from 2c55999 to d9d2899 Compare January 10, 2026 14:20
@choo121600
Copy link
Member

It looks like a test for "cancelled backfill cannot be resumed" might be missing.

@vatsrahul1001
Copy link
Contributor

@KyeongJooni Thanks for the fixes. I see tests are passing now, they all have retries and are flaky. Could you investigate it

@KyeongJooni
Copy link
Contributor Author

@KyeongJooni Thanks for the fixes. I see tests are passing now, they all have retries and are flaky. Could you investigate it

Investigated and fixed in d02b5eb. The issue was .catch(() => undefined) on waitForResponse - when the response wasn't caught, the test proceeded without waiting for the API to complete. Removed the catch and increased timeout. Hopefully the tests will be stable now.

@choo121600
Copy link
Member

choo121600 commented Jan 21, 2026

@KyeongJooni it would be helpful if you could verify that all tests pass locally without flakiness, mark the resolved comments as resolved, and provide a brief summary of the changes.
Feel free to mention me when the next round of review is needed 😉

@KyeongJooni
Copy link
Contributor Author

KyeongJooni commented Jan 21, 2026

@KyeongJooni it would be helpful if you could verify that all tests pass locally without flakiness, mark the resolved comments as resolved, and provide a brief summary of the changes. Feel free to mention me when the next round of review is needed 😉

@choo121600

Summary of Changes

  1. Extended backfill date range (1 day → 60 days) to ensure backfill runs long enough for pause/cancel tests
  2. Added retry logic in beforeEach using expect().toPass() to handle race conditions
  3. Added waitForBackdropClosed() to fix Chakra UI dialog timing issues
  4. Added 409 conflict handling in createBackfill() for retry on conflict

All resolved comments have been marked. I expect the tests to pass with these changes, but let me know if any issues remain.

Copy link
Member

@choo121600 choo121600 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool, Looks good!
All tests are passing, and this part looks fine to me.
Thanks for the hard work 🙂

@vatsrahul1001
Copy link
Contributor

@KyeongJooni, Great work. One last thing, I see tests are passing, but on retry, can you check why there is flakiness?

@KyeongJooni
Copy link
Contributor Author

@KyeongJooni, Great work. One last thing, I see tests are passing, but on retry, can you check why there is flakiness?

@vatsrahul1001 The flakiness in backfill tests has been resolved. The only flaky test in the latest CI run is xcoms.spec.ts, which is unrelated to this PR. All backfill tests pass without retry on all browsers (Chromium, Firefox, WebKit).

@vatsrahul1001
Copy link
Contributor

Great work @KyeongJooni !

@vatsrahul1001 vatsrahul1001 merged commit 4e8274c into apache:main Jan 26, 2026
77 checks passed
@boring-cyborg
Copy link

boring-cyborg bot commented Jan 26, 2026

Awesome work, congrats on your first merged pull request! You are invited to check our Issue Tracker for additional contributions.

@choo121600
Copy link
Member

Awesome, @KyeongJooni congrats on your first merge 🎉
Thanks for the contribution!

suii2210 pushed a commit to suii2210/airflow that referenced this pull request Jan 26, 2026
Add E2E tests for backfill pause and stop controls

Co-authored-by: Rahul Vats <43964496+vatsrahul1001@users.noreply.github.com>
Co-authored-by: Yeonguk Choo <choo121600@gmail.com>
shreyas-dev pushed a commit to shreyas-dev/airflow that referenced this pull request Jan 29, 2026
Add E2E tests for backfill pause and stop controls

Co-authored-by: Rahul Vats <43964496+vatsrahul1001@users.noreply.github.com>
Co-authored-by: Yeonguk Choo <choo121600@gmail.com>
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.

UI E2E || DAG-013: Pause & Stop backfill

3 participants