Skip to content

test: fix race condition for upload files#27650

Merged
siddhant1 merged 3 commits intomainfrom
csv-import-test
Apr 23, 2026
Merged

test: fix race condition for upload files#27650
siddhant1 merged 3 commits intomainfrom
csv-import-test

Conversation

@anuj-kumary
Copy link
Copy Markdown
Member

@anuj-kumary anuj-kumary commented Apr 23, 2026

Describe your changes:

Fix race condition with the Loader
The Loader was dismissed in a finally block that runs synchronously before the file is actually read. If React doesn't batch the show/hide Loader state updates (e.g. when the event is called outside React's batching scope), the upload widget briefly detaches from DOM giving a false-positive hidden signal. The test then checks for .rdg-header-row immediately, but the file hasn't been read yet and no API call has been made.

The fix keeps the Loader visible until reader.onload actually fires, i.e. until the file is fully read. As a bonus, reader.onerror now also properly shows an error toast previously the error thrown inside an async callback was silently swallowed since the surrounding try/catch could never intercept it.

Screenshot 2026-04-23 at 11 32 32 AM

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.

@anuj-kumary anuj-kumary self-assigned this Apr 23, 2026
@anuj-kumary anuj-kumary requested a review from a team as a code owner April 23, 2026 06:13
@anuj-kumary anuj-kumary added UI UI specific issues safe to test Add this label to run secure Github workflows on PRs labels Apr 23, 2026
@gitar-bot
Copy link
Copy Markdown

gitar-bot Bot commented Apr 23, 2026

Code Review ✅ Approved

Adds a CSV import test suite to verify data ingestion workflows. 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

@github-actions
Copy link
Copy Markdown
Contributor

Jest test Coverage

UI tests summary

Lines Statements Branches Functions
Coverage: 61%
62.01% (60373/97355) 42.01% (31637/75306) 45.01% (9503/21112)

@sonarqubecloud
Copy link
Copy Markdown

@anuj-kumary anuj-kumary changed the title Csv import test test: fix race condition for upload files Apr 23, 2026
@github-actions
Copy link
Copy Markdown
Contributor

🟡 Playwright Results — all passed (17 flaky)

✅ 3694 passed · ❌ 0 failed · 🟡 17 flaky · ⏭️ 89 skipped

Shard Passed Failed Flaky Skipped
🟡 Shard 1 479 0 2 4
🟡 Shard 2 653 0 3 7
🟡 Shard 3 663 0 3 1
🟡 Shard 4 646 0 2 27
🟡 Shard 5 610 0 1 42
🟡 Shard 6 643 0 6 8
🟡 17 flaky test(s) (passed on retry)
  • Features/TeamsHierarchy.spec.ts › Delete Parent Team (shard 1, 1 retry)
  • Pages/AuditLogs.spec.ts › should apply both User and EntityType filters simultaneously (shard 1, 1 retry)
  • Features/BulkEditEntity.spec.ts › Glossary (shard 2, 1 retry)
  • Features/DataQuality/TestCaseImportExportE2eFlow.spec.ts › Admin: Complete export-import-validate flow (shard 2, 1 retry)
  • Features/DataQuality/TestCaseResultPermissions.spec.ts › User with only VIEW cannot PATCH results (shard 2, 1 retry)
  • Features/RTL.spec.ts › Verify Following widget functionality (shard 3, 1 retry)
  • Flow/PersonaDeletionUserProfile.spec.ts › User profile loads correctly before and after persona deletion (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/DataContractsSemanticRules.spec.ts › Validate Description Rule Is_Set (shard 4, 1 retry)
  • Pages/Glossary.spec.ts › Add and Remove Assets (shard 5, 1 retry)
  • Pages/Lineage/DataAssetLineage.spec.ts › verify create lineage for entity - Table (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)
  • Pages/Lineage/PlatformLineage.spec.ts › Verify domain platform view (shard 6, 1 retry)
  • Pages/Users.spec.ts › Permissions for table details page for Data Consumer (shard 6, 1 retry)
  • Pages/Users.spec.ts › Check permissions for Data Steward (shard 6, 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

@siddhant1 siddhant1 merged commit 365d30b into main Apr 23, 2026
47 checks passed
@siddhant1 siddhant1 deleted the csv-import-test branch April 23, 2026 08:40
anuj-kumary added a commit that referenced this pull request Apr 28, 2026
* test: resolve flaky CSVImportWithQuotesAndCommas test due to timeout race condition

* fix lint issue

(cherry picked from commit 365d30b)
jatinmasaram pushed a commit to jatinmasaram/OpenMetadata that referenced this pull request May 2, 2026
* test: resolve flaky CSVImportWithQuotesAndCommas test due to timeout race condition

* fix lint issue
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 UI UI specific issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants