Skip to content

Fixed AuditLog and Pagination flakiness#27322

Open
Rohit0301 wants to merge 4 commits intomainfrom
fix-audit-log-and-pagination-spec
Open

Fixed AuditLog and Pagination flakiness#27322
Rohit0301 wants to merge 4 commits intomainfrom
fix-audit-log-and-pagination-spec

Conversation

@Rohit0301
Copy link
Copy Markdown
Contributor

@Rohit0301 Rohit0301 commented Apr 13, 2026

Describe your changes:

Fixes

I worked on ... because ...

Screen.Recording.2026-04-13.at.6.26.51.PM.mov
Screen.Recording.2026-04-13.at.7.15.53.PM.mov

Type of change:

  • Bug fix
  • Improvement
  • New feature
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation

Checklist:

  • I have read the CONTRIBUTING document.
  • My PR title is Fixes <issue-number>: <short explanation>
  • I have commented on my code, particularly in hard-to-understand areas.
  • For JSON Schema changes: I updated the migration scripts or explained why it is not needed.

Summary by Gitar

  • Test flakiness fixes:
    • Improved race condition handling in testPaginationNavigation by using Promise.all() to ensure response is captured before navigation
    • Added scroll-into-view and enabled state checks for pagination buttons
  • Test data improvements:
    • Replaced sequential IDs with uuid() for unique user creation to prevent test collisions
    • Moved const object declarations to let in test.beforeAll hooks for proper initialization
  • Audit log reliability:
    • Increased POLL_TIMEOUT from 60000ms to 120000ms for slower test environments
    • Added explicit wait for custom properties API response in beforeEach hook
    • Refactored conditional audit entry lookups using nullish coalescing operator (??)

This will update automatically on new commits.

const customPropertiesResponsePromise = page.waitForResponse(
(response) =>
response.url().includes('/api/v1/metadata/types/customProperties'),
{ timeout: 180000 }
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.

why we need timeout here?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

remove

response.url().includes('entityType=') &&
response.request().method() === 'GET'
response.request().method() === 'GET',
{ timeout: 180000 }
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.

same here

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR aims to reduce Playwright E2E flakiness around Audit Logs and pagination flows in the OpenMetadata UI test suite by making network waits and test data more deterministic/isolated.

Changes:

  • Stabilized pagination navigation by coordinating the “next” click with the expected page-2 network response and ensuring the button is interactable.
  • Increased Audit Logs polling/response wait timeouts and streamlined fallback audit-entry lookup logic.
  • Improved pagination test isolation by using unique IDs for user test data and moving entity initialization into beforeAll.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
openmetadata-ui/src/main/resources/ui/playwright/utils/common.ts Makes pagination navigation less race-prone by synchronizing click + response and ensuring the next button is ready.
openmetadata-ui/src/main/resources/ui/playwright/e2e/Pages/AuditLogs.spec.ts Adds explicit API readiness checks and extends timeouts/polling to reduce Audit Log-related flakiness.
openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/Pagination.spec.ts Improves test isolation by using unique identifiers and initializing shared entities in beforeAll.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 13, 2026

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 63%
63.92% (59758/93481) 43.62% (31232/71590) 46.73% (9395/20103)

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 13, 2026

🟡 Playwright Results — all passed (32 flaky)

✅ 3593 passed · ❌ 0 failed · 🟡 32 flaky · ⏭️ 207 skipped

Shard Passed Failed Flaky Skipped
🟡 Shard 1 452 0 5 2
🟡 Shard 2 642 0 2 32
🟡 Shard 3 640 0 9 26
🟡 Shard 4 619 0 8 47
🟡 Shard 5 608 0 1 67
🟡 Shard 6 632 0 7 33
🟡 32 flaky test(s) (passed on retry)
  • Features/CustomizeDetailPage.spec.ts › Domain - customization should work (shard 1, 1 retry)
  • Flow/Metric.spec.ts › Verify Related Metrics Update (shard 1, 1 retry)
  • Flow/Tour.spec.ts › Tour should work from help section (shard 1, 1 retry)
  • Flow/Tour.spec.ts › Tour should work from URL directly (shard 1, 1 retry)
  • Pages/UserCreationWithPersona.spec.ts › Create user with persona and verify on profile (shard 1, 1 retry)
  • Features/BulkEditEntity.spec.ts › Glossary (shard 2, 1 retry)
  • Features/ChangeSummaryBadge.spec.ts › Automated badge should appear on entity description with Automated source (shard 2, 1 retry)
  • Features/Permissions/GlossaryPermissions.spec.ts › Team-based permissions work correctly (shard 3, 1 retry)
  • Features/RestoreEntityInheritedFields.spec.ts › Validate restore with Inherited domain and data products assigned (shard 3, 1 retry)
  • Features/RestoreEntityInheritedFields.spec.ts › Validate restore with Inherited domain and data products assigned (shard 3, 2 retries)
  • Features/RestoreEntityInheritedFields.spec.ts › Validate restore with Inherited domain and data products assigned (shard 3, 1 retry)
  • Features/RestoreEntityInheritedFields.spec.ts › Validate restore with Inherited domain and data products assigned (shard 3, 1 retry)
  • Features/RestoreEntityInheritedFields.spec.ts › Validate restore with Inherited domain and data products assigned (shard 3, 1 retry)
  • Features/RTL.spec.ts › Verify Following widget functionality (shard 3, 1 retry)
  • Flow/ObservabilityAlerts.spec.ts › Test case alert (shard 3, 1 retry)
  • Flow/PersonaFlow.spec.ts › Set default persona for team should work properly (shard 3, 1 retry)
  • Pages/Customproperties-part2.spec.ts › entityReferenceList shows item count, scrollable list, no expand toggle (shard 4, 1 retry)
  • Pages/DataContracts.spec.ts › Create Data Contract and validate for SearchIndex (shard 4, 1 retry)
  • Pages/DataContracts.spec.ts › Create Data Contract and validate for Database (shard 4, 1 retry)
  • Pages/DataContractsSemanticRules.spec.ts › Validate Description Rule Is_Not_Set (shard 4, 1 retry)
  • Pages/Domains.spec.ts › Should clear assets from data products after deletion of data product in Domain (shard 4, 1 retry)
  • Pages/Domains.spec.ts › Multiple consecutive domain renames preserve all associations (shard 4, 1 retry)
  • Pages/DomainUIInteractions.spec.ts › Select domain from global dropdown filters explore (shard 4, 1 retry)
  • Pages/Entity.spec.ts › Glossary Term Add, Update and Remove (shard 4, 1 retry)
  • Pages/EntityDataConsumer.spec.ts › Tier Add, Update and Remove (shard 5, 1 retry)
  • Pages/HyperlinkCustomProperty.spec.ts › should accept valid http and https URLs (shard 6, 1 retry)
  • Pages/Lineage/DataAssetLineage.spec.ts › verify create lineage for entity - Search Index (shard 6, 1 retry)
  • Pages/Lineage/DataAssetLineage.spec.ts › verify create lineage for entity - Data Model (shard 6, 1 retry)
  • Pages/Lineage/LineageFilters.spec.ts › Verify lineage schema filter selection (shard 6, 1 retry)
  • Pages/Lineage/LineageRightPanel.spec.ts › Verify custom properties tab IS visible for supported type: searchIndex (shard 6, 1 retry)
  • ... and 2 more

📦 Download artifacts

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

@gitar-bot
Copy link
Copy Markdown

gitar-bot bot commented Apr 13, 2026

Code Review ✅ Approved

Fixes flakiness in AuditLog and Pagination components through targeted stability improvements. No issues found.

Options

Display: compact → Showing less information.

Comment with these commands to change:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@sonarqubecloud
Copy link
Copy Markdown

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants