fix(test): scope SearchExport Download button to its specific job row - #31648
anuj-kumary merged 2 commits into
Conversation
The test picked the first Download button in the tray via
.getByRole('button', { name: 'Download' }).first(), which could belong
to an already-completed job (e.g. "Exported Lineage") while the Data
Assets export was still in progress. Clicking the wrong button triggered
a result request for a different jobId, so waitForResponse (filtered for
the correct jobId) timed out after 60 s.
Fix: add data-testid={`csv-job-${job.jobId}`} to each CsvJobsTray item
div, then scope the locator in the test to that row before finding the
Download button. This ensures we always click the button that belongs to
the job we started.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
❌ 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 |
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
Code Review ✅ ApprovedScopes the SearchExport Download button selector to its specific job row using a data-testid attribute to prevent flaky test timeouts caused by picking the first visible download button. No issues found. OptionsDisplay: compact → Showing less information. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
|
Hi there 👋 Thanks for your contribution! The OpenMetadata team will review the PR shortly! Once it has been labeled as Let us know if you need any help! |
|
8e48a37
|
Failed to cherry-pick changes to the 1.13 branch. |
|
Failed to cherry-pick changes to the 2.0 branch. |
…1648) The test picked the first Download button in the tray via .getByRole('button', { name: 'Download' }).first(), which could belong to an already-completed job (e.g. "Exported Lineage") while the Data Assets export was still in progress. Clicking the wrong button triggered a result request for a different jobId, so waitForResponse (filtered for the correct jobId) timed out after 60 s. Fix: add data-testid={`csv-job-${job.jobId}`} to each CsvJobsTray item div, then scope the locator in the test to that row before finding the Download button. This ensures we always click the button that belongs to the job we started. Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>



Problem
SearchExport.spec.tsflakes with:Root cause: the test selected the Download button with
.getByRole('button', { name: 'Download' }).first()— an unscoped selector that picks the first Download button visible in the tray. When other jobs were already completed in the tray (e.g. "Exported Lineage"), their Download button appeared before the Data Assets export finished. Clicking it triggered a/csvAsyncJobs/<wrong-jobId>/resultrequest that never matched the filter waiting for the Data AssetsjobId.Fix
CsvJobsTray.component.tsx: adddata-testid={csv-job-${job.jobId}}to each tray itemdiv.SearchExport.spec.ts: after the API confirmsCOMPLETED, locate the row by[data-testid="csv-job-${jobId}"]and find the Download button within that row.Test plan
SearchExport.spec.ts"Export queues a background job and downloads from the jobs tray" with other completed export jobs already visible — download resolves against the correct jobId.CsvJobsTray.spec.tssuite to confirm no regressions.🤖 Generated with Claude Code
Greptile Summary
This PR scopes the Search Export test’s Download action to the row for the job created by the test.
Confidence Score: 5/5
The PR appears safe to merge.
No blocking failure remains.
Important Files Changed
Reviews (2): Last reviewed commit: "Merge branch 'main' into fix/search-expo..." | Re-trigger Greptile