Skip to content

fix(test): scope SearchExport Download button to its specific job row - #31648

Merged
anuj-kumary merged 2 commits into
open-metadata:mainfrom
anuj-kumary:fix/search-export-download-button-scope
Aug 17, 2026
Merged

anuj-kumary merged 2 commits into
open-metadata:mainfrom
anuj-kumary:fix/search-export-download-button-scope

Conversation

@anuj-kumary

@anuj-kumary anuj-kumary commented Aug 17, 2026 •

Copy link
Copy Markdown
Member

Problem

SearchExport.spec.ts flakes with:

TimeoutError: page.waitForResponse: Timeout 60000ms exceeded while waiting for event "response"

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>/result request that never matched the filter waiting for the Data Assets jobId.

Fix

  • CsvJobsTray.component.tsx: add data-testid={csv-job-${job.jobId}} to each tray item div.
  • SearchExport.spec.ts: after the API confirms COMPLETED, locate the row by [data-testid="csv-job-${jobId}"] and find the Download button within that row.

Test plan

  • Run 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.
  • Run CsvJobsTray.spec.ts suite 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.

  • Adds a stable job-specific test identifier to CSV tray rows.
  • Uses that identifier to select the matching Download button instead of the first visible one.

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/SearchExport.spec.ts Replaces the ambiguous tray-wide Download selector with a job-scoped selector and relies on the tray’s existing polling to expose terminal state.
openmetadata-ui/src/main/resources/ui/src/components/common/EntityImport/CsvJobsTray/CsvJobsTray.component.tsx Adds a job-ID-based test identifier to each rendered CSV job row without changing production behavior.

Reviews (2): Last reviewed commit: "Merge branch 'main' into fix/search-expo..." | Re-trigger Greptile

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>
@github-actions

Copy link
Copy Markdown
Contributor

❌ PR checklist incomplete

This PR cannot be merged until the following are addressed on its linked issue:

  • No GitHub issue is linked. Link an issue in the Development section of the PR (or add Fixes #12345 to the description). For a same-org cross-repo issue, add Fixes open-metadata/<repo>#123 to the description.

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 skip-pr-checks label.

@github-actions github-actions Bot added the UI UI specific issues label Aug 17, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

@gitar-bot

gitar-bot Bot commented Aug 17, 2026

Copy link
Copy Markdown
Code Review ✅ Approved

Scopes 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.

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 👍 / 👎 | Powered by Gitar — free for open source

@anuj-kumary anuj-kumary self-assigned this Aug 17, 2026
@anuj-kumary anuj-kumary added skip-pr-checks Bypass PR metadata validation check safe to test Add this label to run secure Github workflows on PRs labels Aug 17, 2026
@github-actions github-actions Bot removed the safe to test Add this label to run secure Github workflows on PRs label Aug 17, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Hi there 👋 Thanks for your contribution!

The OpenMetadata team will review the PR shortly! Once it has been labeled as safe to test, the CI workflows
will start executing and we'll be able to make sure everything is working as expected.

Let us know if you need any help!

@anuj-kumary anuj-kumary added the safe to test Add this label to run secure Github workflows on PRs label Aug 17, 2026
@anuj-kumary
anuj-kumary enabled auto-merge August 17, 2026 16:19
@github-actions

Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 66%
66.85% (79908/119524) 51.25% (48770/95151) 52.23% (14599/27951)

@sonarqubecloud

Copy link
Copy Markdown

@anuj-kumary
anuj-kumary added this pull request to the merge queue Aug 17, 2026
@anuj-kumary anuj-kumary added the To release Will cherry-pick this PR into the release branch label Aug 17, 2026
Merged via the queue into open-metadata:main with commit 8e48a37 Aug 17, 2026
209 of 219 checks passed
@anuj-kumary
anuj-kumary deleted the fix/search-export-download-button-scope branch August 17, 2026 20:53
@github-actions

Copy link
Copy Markdown
Contributor

Failed to cherry-pick changes to the 1.13 branch.
Please cherry-pick the changes manually.
You can find more details here.

@github-actions

Copy link
Copy Markdown
Contributor

Failed to cherry-pick changes to the 2.0 branch.
Please cherry-pick the changes manually.
You can find more details here.

anuj-kumary added a commit that referenced this pull request Aug 18, 2026
…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>

This branch was previously deployed

1 inactive deployment
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 skip-pr-checks Bypass PR metadata validation check 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.

2 participants