Skip to content

Fix the flakiness in Service playwright tests - #30532

Queued
aniketkatkar97 wants to merge 6 commits into
mainfrom
fix-service-AUT
Queued

Fix the flakiness in Service playwright tests#30532
aniketkatkar97 wants to merge 6 commits into
mainfrom
fix-service-AUT

Conversation

@aniketkatkar97

@aniketkatkar97 aniketkatkar97 commented Jul 27, 2026

Copy link
Copy Markdown
Member

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:

  • Replaced the previous mockPipelineEnabledState with a new mockToggleFlow function 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:

  • Switched from using a service class instance to referencing EntityDataClass.databaseService and updated navigation to use the service's FQN directly, avoiding unnecessary redirection and clicks.
  • Removed the redirectToHomePage and service.visitEntityPage calls, directly navigating to the agents tab using the encoded FQN.

Code cleanup and utility removal:

  • Removed the now-unnecessary clickAndAwaitToggle helper and the afterAll cleanup, simplifying the test file and focusing only on pause/resume logic. [1] [2]

Test logic and reliability improvements:

  • Updated the test cases to explicitly wait for the correct network responses and UI states, ensuring the pause/resume flow is reliably exercised and validated.

Documentation and comments:

  • Improved code comments to clarify why and how the mocking is done, explaining the Airflow boundary and the rationale for the new approach.

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.

  • Adds stateful pause/resume API mocks and direct agent-tab navigation.
  • Replaces real ingestion run-history setup with deterministic mocked statuses.
  • Moves selected nightly scenarios to API-based setup and updates ingestion filter interactions.

Confidence Score: 5/5

The PR appears safe to merge.

No blocking failure remains.

Important Files Changed

Filename Overview
openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/ServiceAgentsPauseResume.spec.ts Reworks pause/resume coverage around a shared service fixture and stateful ingestion-pipeline mocks.
openmetadata-ui/src/main/resources/ui/playwright/e2e/nightly/ServiceIngestion.spec.ts Replaces expensive live run-history setup with mocked statuses and simplifies service setup for targeted scenarios.
openmetadata-ui/src/main/resources/ui/playwright/support/entity/ingestion/MlFlowIngestionClass.ts Opens and selects the ML model filter before entering its include pattern.
openmetadata-ui/src/main/resources/ui/playwright/support/entity/ingestion/S3IngestionClass.ts Updates container-filter interaction to use the current filter-section controls.
openmetadata-ui/src/main/resources/ui/playwright/support/entity/ingestion/SnowflakeIngestionClass.ts Updates schema-filter interaction to use the current filter-section controls.
openmetadata-ui/src/main/resources/ui/playwright/support/entity/ingestion/SupersetIngestionClass.ts Corrects the selected filter section from schema filters to dashboard filters.

Reviews (5): Last reviewed commit: "Merge branch 'main' into fix-service-AUT" | Re-trigger Greptile

@aniketkatkar97 aniketkatkar97 self-assigned this Jul 27, 2026
Copilot AI review requested due to automatic review settings July 27, 2026 14:36
@aniketkatkar97
aniketkatkar97 requested a review from a team as a code owner July 27, 2026 14:36
@aniketkatkar97 aniketkatkar97 added the To release Will cherry-pick this PR into the release branch label Jul 27, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

github-actions Bot commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

✅ PR checks passed

The linked issue has a description and all required Shipping project fields set. Thanks!

@github-actions github-actions Bot added safe to test Add this label to run secure Github workflows on PRs UI UI specific issues labels Jul 27, 2026
Copilot AI review requested due to automatic review settings July 27, 2026 14:50

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings July 28, 2026 13:09

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

Copilot AI review requested due to automatic review settings July 28, 2026 13:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@open-metadata open-metadata deleted a comment from github-actions Bot Jul 28, 2026
Copilot AI review requested due to automatic review settings July 28, 2026 13:52

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@gitar-bot

gitar-bot Bot commented Jul 28, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 2 resolved / 2 findings

Refactors 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

📄 openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/ServiceAgentsPauseResume.spec.ts:97-111
This test now attaches an ingestion pipeline to the globally-shared EntityDataClass.databaseService in beforeAll, but the afterAll cleanup was removed, so the pipeline persists for the rest of the run. Other tests that use the same shared database service and inspect its agents/ingestion-pipeline list could see this stray pipeline and become flaky. Add an afterAll that deletes the created pipeline (DELETE /api/v1/services/ingestionPipelines/{id}) using the id from pipelineResponse.

Bug: Removed 11-min block timeout leaves slow ingestion tests at 60s

📄 openmetadata-ui/src/main/resources/ui/playwright/e2e/nightly/ServiceIngestion.spec.ts:90-103
This commit removed the test.describe.configure({ timeout: 11 * 60 * 1000 }) that applied to every test in the serial block, but only added test.slow() (which triples the default 60s to 180s) to the Create & Ingest test. The Update description and verify description after re-run test calls updateServiceupdateDescriptionForIngestedTableshandleIngestionRetryexecuteIngestionRetrySteps, which polls pipeline status with an internal timeout of 750_000ms (ServiceBaseClass.ts:374). Under the reinstated default 60s Playwright test timeout, this test will be aborted long before the ingestion run completes, reintroducing failures/flakiness. Add test.slow() (or an explicit larger test.setTimeout(...)) to the update/rerun test as well.

Options

Display: compact → Showing less information.

Comment with these commands to change the behavior for this request:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar | Powered by Gitar — free for open source

@github-actions

Copy link
Copy Markdown
Contributor

✅ Playwright Results — workflow succeeded

Validated commit bce614905a6a854e92c171ff65963d3fcf073131 in Playwright run 30365603123, attempt 1.

✅ 537 passed · ❌ 0 failed · 🟡 1 flaky · ⏭️ 5 skipped · 🧰 0 lifecycle flaky

Performance

Blocking 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:

  • Browser traffic was 203.35 requests per attempt (convergence target: fewer than 200).
  • Application boot ratio was 2.87 per UI scenario (1605 boots / 560 scenarios; convergence target: at most 1).
Shard Passed Failed Flaky Skipped Lifecycle failed Lifecycle flaky
🟡 Shard chromium-01 82 0 1 0 0 0
✅ Shard chromium-02 104 0 0 0 0 0
✅ Shard chromium-03 111 0 0 3 0 0
✅ Shard chromium-04 102 0 0 0 0 0
✅ Shard data-asset-rules-01 61 0 0 0 0 0
✅ Shard domain-isolation-01 14 0 0 0 0 0
✅ Shard global-state-01 23 0 0 0 0 0
✅ Shard ingestion-01 1 0 0 0 0 0
✅ Shard reindex-01 2 0 0 0 0 0
✅ Shard search-01 10 0 0 0 0 0
✅ Shard search-rbac-01 27 0 0 2 0 0
🟡 1 flaky test(s) (passed on retry)
  • Pages/Entity.spec.tsDomain Propagation (shard chromium-01, 1 retry)

📦 Download artifacts

How to debug locally
# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip    # view trace

@aniketkatkar97
aniketkatkar97 added this pull request to the merge queue Jul 28, 2026
Any commits made after this event will not be merged.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

safe to test Add this label to run secure Github workflows on PRs To release Will cherry-pick this PR into the release branch UI UI specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Flaky Service / ingestion Playwright tests block CI

3 participants