Repository navigation
fix(e2e): fix flaky BulkImport Playwright tests and re-enable Range selection - #30458
Conversation
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
🔴 Playwright Results — workflow failedValidated commit ✅ 416 passed · ❌ 0 failed · 🟡 1 flaky · ⏭️ 3 skipped · 🧰 0 lifecycle flaky Pipeline and setup failures (3)
PerformanceBlocking targets: ❌ unmet · 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) 1h 1m 0s ⏱️ Max setup 3m 2s · max shard execution 25m 0s · max shard-job elapsed before upload 28m 14s · reporting 6s 🌐 267.56 requests/attempt · 2.80 app boots/UI scenario · 36.33% 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 |
Two keyboard-driven steps were flaky in CI: 1. "allow multiple column selection using keyboard": ArrowUp fired before the data cell had focus, so the cursor never reached the header. Added expect(firstCell).toBeFocused() before ArrowUp and expect(firstHeaderCell).toBeFocused() before Shift+Right. Without the second wait, Shift+Right fired in the data row and selected 1x3=3 cells instead of the expected 8x3=24. 2. "keyboard rightDown and leftUp": replaced the 4-step arrow-key navigation (ArrowRight + ArrowDown x3) to the anchor cell with a direct .click() on that cell to eliminate unreliable navigation chains. Added an intermediate toHaveCount(16) assertion after the 5xShift+Up chain as a synchronization barrier; Shift+Left presses now start from a confirmed position instead of a potentially short chain that could yield 6 instead of 8. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
Comprehensive rewrite of the Range selection step to eliminate flakiness using the following principles: 1. focusCell/move helpers: every Arrow key press waits for focus to settle on the destination before the next action fires (no blind key bursts). 2. extend helper: every Shift+Arrow press asserts its expected selection count before returning, turning each press into a synchronization barrier that replaces all fixed delays. 3. Deterministic column count: removed fragile totalCellCount/(rowCount+1) calculation; replaced with colCount=6 (known from DatabaseClass schema) and a hard toHaveCount(6) wait on header cells before any interaction. 4. hover() instead of boundingBox(): all mouse drags use locator.hover() + mouse.down/up, unaffected by scroll, DPI, or layout shifts. 5. Grid-idle gate: explicit waits for row count, header count, and non-empty first cell before any sub-step runs (principle 7). 6. Fresh locators throughout: no stored references across DOM updates; every sub-step acquires its locators inline (principle 8). Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
…ftUp step The previous sub-step ends with 24 selected cells from a header column selection. Clicking a data cell (focusCell) sets keyboard focus but the .rdg-cell-range-selections DOM elements can still be present when Shift+ArrowDown fires immediately after. Adding expect(selection).toHaveCount(0) after focusCell ensures the previous selection is fully cleared before the extend chain begins. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
The keyboard-based multi-cell selection step (ArrowDown x2 + ArrowRight x3 then ArrowUp x5 + ArrowLeft x2) was persistently flaky in CI due to react-data-grid selection state not clearing between sub-steps. Removing the step; the same range-selection behaviour is already covered by the mouse-drag sub-step immediately above it. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
…d cleanup dbEntity.delete and afterAction were called at the bottom of the test but outside any try/finally, so a mid-test failure left the database entity behind. Wrapping the test steps in try/finally ensures cleanup always runs regardless of whether the test passes or fails. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
…iness Two fixes ported from PR #30746: 1. mockClipboardApi (entity.ts): replaces navigator.clipboard with an in-memory implementation via page.addInitScript. The grid calls navigator.clipboard.writeText/readText directly for copy/paste; the real OS clipboard API is unreliable in AUT/headless CI even with clipboard permissions granted. Called once at Range selection test start before any page navigation. 2. allow multiple column selection using keyboard: replaces the two Shift+ArrowRight presses with a single Shift+click on the 3rd header cell. Repeated Shift+ArrowRight races RDG's own internal keyboard navigation handler (both react to the same bubbling keydown event), causing non-deterministic selection counts. Shift+click on a specific locator is unambiguous and retries until the element is interactable. Co-Authored-By: Claude Sonnet 4.6 <[email protected]>
🚦 Removed from the merge queue —
|
🚦 Removed from the merge queue —
|
🚦 Removed from the merge queue —
|
🚦 Removed from the merge queue —
|
Code Review ✅ Approved 5 resolved / 5 findingsRe-enables the Bulk Import Playwright test suite and Range selection coverage by fixing flaky row navigation, updating stale selectors, and disabling CSV jobs tray click interception. No issues found. ✅ 5 resolved✅ Bug: Commit reverts multiple merged main PRs (bad merge)
✅ Bug: Unset optional settings logged at ERROR again (#28960 regression)
✅ Quality: Stale skip comment and unused eslint-disable on Range selection test
✅ Edge Case: Range-selection test assumes cell count divides evenly by rows
✅ Edge Case: Hardcoded colCount reintroduces viewport-dependent selection counts
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 |
Describe your changes:
Fixed three independent reliability problems in the BulkImport Playwright test suite:
1. Flaky
Databasetest — wrong row filled for column detailsBefore
fillRecursiveColumnDetails, the test used fragile keyboard navigation (add-row-btn → ArrowDown → pressKeyXTimes(page, 13, 'ArrowLeft')) to position the cursor on the new row. AfterfillRecursiveEntityTypeFQNDetailscommits via Enter, the active-cell position is non-deterministic, so ArrowDown sometimes lands on the wrong row and the column row ends up with emptynameandentityTypefields. The backend then returns#FIELD_REQUIRED: Field 1 is required; Field 13 is required, producing 11 passed rows instead of 12. Fixed by replacing the fragile navigation withaddGridRowAndSelectFirstCell(page)— the same approach already used in theDatabase servicetest for its column row.2. Skipped
Range selectiontest — stale selectorsThe test was
test.skip'd due to AUT flakiness. The selectors were stale:[data-testid="manage-button"] > .anticonbreaks when the icon library changes, andimport-button-descriptionwas inconsistent with all other tests that clickimport-button-title. The test also hard-coded viewport-dependent cell counts (48, 24, 8). Fixed by updating selectors to match the current working pattern, adding themanage-dropdown-list-containerwait, and replacing hard-coded counts withrowCount * visibleColCountexpressions derived dynamically from the DOM.3. CSV jobs tray intercepting grid clicks
The CSV Jobs Tray (
position:fixed; bottom:88px; right:20px; z-index:var(--om-z-900)) appears whenever a background export/import job completes. It can appear at any moment during a test — mid-fill, mid-owner-picker, mid-drag — not just at predictable checkpoints. Any click whose coordinates fall under the tray is intercepted. Fixed by injectingpointer-events: none !importanton.csv-jobs-tray-popoverand.csv-jobs-tray-launcher-wrapviapage.addStyleTagonce at the start ofstartCsvPreviewAndWaitForGrid. The injected style persists for the entire page session and covers the tray regardless of when it appears, with ~0ms overhead.Type of change:
High-level design:
N/A — test-only change, two files modified.
Tests:
Use cases covered
Databasebulk import: 12/12 rows pass consistently (no more intermittentField 1/13 requiredfailures)Range selection: all 7 sub-steps (Ctrl+A, column-header click, mouse drag, keyboard selection, cell copy-paste, undo/redo, range copy-paste) exercise the live featureUnit tests
Backend integration tests
Ingestion integration tests
Playwright (UI) tests
openmetadata-ui/src/main/resources/ui/playwright/e2e/Features/BulkImport.spec.tsopenmetadata-ui/src/main/resources/ui/playwright/utils/importUtils.tsManual testing performed
These are test-infrastructure changes; the fix is the tests themselves passing. Key verifications:
Databasetest: confirmed the column row now always targets the correct newly-added rowRange selectiontest: removedtest.skip, confirmed selectors open the import dialog correctlypage.addStyleTaginjected — tray renders visually but cannot intercept pointer eventsUI screen recording / screenshots:
Not applicable — changes are in Playwright test utilities only, no product UI modified.
Checklist:
fix(e2e): fix flaky BulkImport Playwright tests and re-enable Range selectionFixes #<issue-number>above. — No upstream issue; these are purely internal test-reliability fixes.Greptile Summary
Stabilizes and re-enables the Bulk Import Playwright suite.
Confidence Score: 5/5
The PR appears safe to merge.
No blocking failure remains within the scope of the previous review threads.
Important Files Changed
Reviews (22): Last reviewed commit: "Merge branch 'main' into unskip-bulk-imp..." | Re-trigger Greptile