sadpandajoe opened a new pull request, #38430:
URL: https://github.com/apache/superset/pull/38430

   ### SUMMARY
   
   Fixes consistent Jest worker OOM crashes in master CI (`sharded-jest-tests` 
shard 7, sometimes 5/6) and a flaky FileHandler test.
   
   **DatasourceControl OOM fix (`fe5f0b0`):**
   - Mock `DatasourceEditor` (2,620 lines, 150+ imports) in 
`DatasourceControl.test.tsx` — the heavy editor was rendered 4+ times per shard 
without mocking, compounding memory until the Jest worker crashed
   - Scope all mocks properly (no `mockImplementationOnce`), await all 
`userEvent` calls, use named fetchMock routes with proper cleanup
   - Heap: 615 MB → 287 MB (54% reduction)
   
   **Regression guards (`289aa1e`):**
   - `afterEach` assertion for unmatched fetchMock calls (catches leaked routes)
   - Pre-commit hook banning `mockImplementationOnce` in DatasourceControl tests
   - Scoped ESLint `testing-library/await-async-events` rule for this test file
   - New CI job: heap check (520 MB threshold), mockImplementationOnce guard, 
un-awaited userEvent guard
   
   **FileHandler flaky test fix (`471205c`):**
   - `setupLaunchQueue` used `setTimeout(fn, 0)` without cleanup — pending 
timers leaked between tests
   - Store timer ID and clear in `afterEach`
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   N/A — test-only changes
   
   ### TESTING INSTRUCTIONS
   ```bash
   # DatasourceControl: all 21 tests pass, heap under 520 MB
   npm run test -- --testPathPatterns DatasourceControl.test --maxWorkers=1
   
   # FileHandler: all 11 tests pass, no flakiness
   npm run test -- --testPathPatterns FileHandler/index.test --maxWorkers=1
   
   # Pre-commit guard
   pre-commit run no-mock-implementation-once-datasource --all-files
   ```
   
   ### ADDITIONAL INFORMATION
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in 
[SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] 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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to