test: fix race condition for upload files#27650
Merged
Conversation
Code Review ✅ ApprovedAdds a CSV import test suite to verify data ingestion workflows. No issues found. OptionsDisplay: compact → Showing less information. Comment with these commands to change:
Was this helpful? React with 👍 / 👎 | Gitar |
Contributor
|
Contributor
🟡 Playwright Results — all passed (17 flaky)✅ 3694 passed · ❌ 0 failed · 🟡 17 flaky · ⏭️ 89 skipped
🟡 17 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 |
siddhant1
approved these changes
Apr 23, 2026
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



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.
Type of change:
Checklist:
Fixes <issue-number>: <short explanation>