You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "rusackas (via GitHub)" <gi...@apache.org> on 2025/12/15 20:43:49 UTC
[PR] fix(tests): resolve flaky ExploreChartHeader export menu tests [superset]
rusackas opened a new pull request, #36642:
URL: https://github.com/apache/superset/pull/36642
### SUMMARY
Fixes flaky tests in `ExploreChartHeader.test.tsx` that were intermittently failing with:
```
Unable to find an element with the text: Export All Data
```
**Root Cause:** After hovering on the menu trigger, the tests immediately tried to hover on nested submenu items ("Data Export Options" → "Export All Data") without waiting for them to render. The `screen.getByText('Data Export Options')` call was synchronous while the submenu rendering was asynchronous.
**Fix:**
1. Replace all synchronous `screen.getByText('Data Export Options')` with async `await screen.findByText('Data Export Options')` in hover operations
2. Remove duplicate jest spy in "Export screenshot (jpeg)" test that conflicted with the sinon spy from beforeEach
### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
N/A - Test fix only
### TESTING INSTRUCTIONS
Run the ExploreChartHeader tests multiple times to verify stability:
```bash
cd superset-frontend
npm run test -- --testPathPatterns="ExploreChartHeader.test.tsx" --no-coverage
```
All 34 tests should pass consistently.
### ADDITIONAL INFORMATION
- [ ] Has associated issue:
- [ ] Required feature flags:
- [ ] Changes UI
- [ ] Includes DB Migration
- [ ] Introduces new feature or API
- [ ] Removes existing feature or API
🤖 Generated with [Claude Code](https://claude.com/claude-code)
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(tests): resolve flaky ExploreChartHeader export menu tests [superset]
Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #36642:
URL: https://github.com/apache/superset/pull/36642#issuecomment-3657534323
AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(tests): resolve flaky ExploreChartHeader export menu tests [superset]
Posted by "codeant-ai-for-open-source[bot] (via GitHub)" <gi...@apache.org>.
codeant-ai-for-open-source[bot] commented on PR #36642:
URL: https://github.com/apache/superset/pull/36642#issuecomment-3657548652
## Nitpicks 🔍
<table>
<tr><td>🔒 <strong>No security issues identified</strong></td></tr>
<tr><td>⚡ <strong>Recommended areas for review</strong><br><br>
- [ ] <a href='https://github.com/apache/superset/pull/36642/files#diff-7e528693a8f9063f0b2889785aba5e3363aa2e27d30274f624dca1639724fe9fR432-R446'><strong>Inconsistent waiting</strong></a><br>The PR fixes several race conditions by switching to async `findByText` for nested menu items, but there are still places using synchronous queries (e.g. `getByLabelText` / `getByText`) elsewhere. Mixed sync/async queries increase the chance of flakiness — ensure all interactions that depend on async rendering consistently await the element (menu trigger, top-level menu, and submenu entries).<br>
- [ ] <a href='https://github.com/apache/superset/pull/36642/files#diff-7e528693a8f9063f0b2889785aba5e3363aa2e27d30274f624dca1639724fe9fR596-R624'><strong>Double restore risk</strong></a><br>Several tests call `spyExportChart.restore()` (and similar restores) inside the test body while an afterEach hook also restores the same sinon spies. Double-restoring a sinon spy/stub can throw or lead to unexpected behavior; centralize restore logic in the shared teardown or remove the extra restores.<br>
</td></tr>
</table>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(tests): resolve flaky ExploreChartHeader export menu tests [superset]
Posted by "codeant-ai-for-open-source[bot] (via GitHub)" <gi...@apache.org>.
codeant-ai-for-open-source[bot] commented on PR #36642:
URL: https://github.com/apache/superset/pull/36642#issuecomment-3657533910
CodeAnt AI is reviewing your PR.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(tests): resolve flaky ExploreChartHeader export menu tests [superset]
Posted by "codeant-ai-for-open-source[bot] (via GitHub)" <gi...@apache.org>.
codeant-ai-for-open-source[bot] commented on PR #36642:
URL: https://github.com/apache/superset/pull/36642#issuecomment-3657548816
CodeAnt AI finished reviewing your PR.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org
Re: [PR] fix(tests): resolve flaky ExploreChartHeader export menu tests [superset]
Posted by "rusackas (via GitHub)" <gi...@apache.org>.
rusackas merged PR #36642:
URL: https://github.com/apache/superset/pull/36642
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org