Fix the flakiness in Service playwright tests - #30532
Conversation
✅ PR checks passedThe linked issue has a description and all required Shipping project fields set. Thanks! |
Code Review ✅ Approved 2 resolved / 2 findingsRefactors Service Playwright tests to replace live pause/resume dependencies and expensive run-history execution with stateful API mocks, addressing the lingering ingestion pipeline cleanup and timeout findings. Tests are now fully deterministic. ✅ 2 resolved✅ Quality: Ingestion pipeline created on shared service is never cleaned up
✅ Bug: Removed 11-min block timeout leaves slow ingestion tests at 60s
OptionsDisplay: compact → Showing less information. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Gitar | Powered by Gitar — free for open source |
✅ Playwright Results — workflow succeededValidated commit ✅ 537 passed · ❌ 0 failed · 🟡 1 flaky · ⏭️ 5 skipped · 🧰 0 lifecycle flaky PerformanceBlocking targets: ✅ met · Optimization targets: 🟡 in progress Shard-job maxima below are not the full workflow wall time; the linked run includes build, fixture, planning, and reporting. 🕒 Full workflow signal wall (to summary) 48m 5s ⏱️ Max setup 2m 52s · max shard execution 14m 27s · max shard-job elapsed before upload 17m 28s · reporting 4s 🌐 203.35 requests/attempt · 2.87 app boots/UI scenario · 5.42% common-shard skew Optimization targets still in progress:
🟡 1 flaky test(s) (passed on retry)
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |
Fixes #30588
This pull request refactors and improves the Playwright test suite for the Service Agents pause/resume feature. The main goals are to make the tests more robust and reliable by mocking the Airflow boundary more comprehensively, simplifying setup and navigation, and removing unnecessary code. The changes also update the test data and utilities to better reflect actual usage.
Test robustness and mocking improvements:
mockPipelineEnabledStatewith a newmockToggleFlowfunction that mocks not only the toggle endpoint but also the listing, single-agent refetch, and progress endpoints, ensuring the UI state is consistent and independent of Airflow or backend state. [1] [2]Test setup and navigation simplification:
EntityDataClass.databaseServiceand updated navigation to use the service's FQN directly, avoiding unnecessary redirection and clicks.redirectToHomePageandservice.visitEntityPagecalls, directly navigating to the agents tab using the encoded FQN.Code cleanup and utility removal:
clickAndAwaitTogglehelper and theafterAllcleanup, simplifying the test file and focusing only on pause/resume logic. [1] [2]Test logic and reliability improvements:
Documentation and comments:
These changes make the test suite more resilient to backend changes and CI environment limitations, while also improving readability and maintainability.
Greptile Summary
Refactors Playwright ingestion-service coverage to reduce reliance on live Airflow and connector state.
Confidence Score: 5/5
The PR appears safe to merge.
No blocking failure remains.
Important Files Changed
Reviews (5): Last reviewed commit: "Merge branch 'main' into fix-service-AUT" | Re-trigger Greptile