SEPURI-SAI-KRISHNA opened a new pull request, #44792: URL: https://github.com/apache/superset/pull/44792
### SUMMARY `AddSemanticViewModal › the save payload carries every selected metric` fails intermittently in `sharded-jest-tests`, including twice on `master` ([2026-09-28](https://github.com/apache/superset/actions/runs/36460676931), [2026-09-21](https://github.com/apache/superset/actions/runs/35575827901)) and on 5 further unrelated branches. Details in #44791. Each metric pick schedules a debounced views refetch (`SCHEMA_REFRESH_DEBOUNCE_MS = 500`), and `fetchViews` clears the current view selection *before* awaiting its response. The test waited only for the `Semantic views` combobox to become enabled, which happens once the first fetch resolves — a later refetch can still be in flight. When it lands after `orders` has been picked it clears `selectedViewNames`, `newViewCount` drops to 0, and `handleSave` returns early without issuing the create request, so the assertion times out. This PR waits for the views refetches to stop before selecting a view, which removes the race. The assertion itself is unchanged: no widened timeout on it, no retries, and no production changes. Note that a widened timeout is *not* the fix here. The final `waitFor` uses the default 1000 ms while its siblings use 10 000 ms, so that looked like the cause — but raising only that timeout made it worse (0/5 passes instead of 1/5), because the request is never issued at all rather than issued late. The product-level issue this exposes — a background refresh discarding the user's selection, after which `Add N view(s)` silently does nothing — is tracked separately and not addressed here. ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF N/A: test-only change. ### TESTING INSTRUCTIONS ```bash cd superset-frontend npm run test -- src/features/semanticViews/AddSemanticViewModal.test.tsx ``` All 11 tests pass. The flake reproduces under CPU contention, so the fix was verified the same way — pinned to 2 cores with 10 busy loops running: ```bash for i in $(seq 1 10); do (while :; do :; done) & done taskset -c 0,1 npx cross-env NODE_ENV=test jest --maxWorkers=1 \ src/features/semanticViews/AddSemanticViewModal.test.tsx \ -t "the save payload carries every selected metric" ``` | | Result | |---|---| | before | 4 of 5 runs **failed** | | after | 8 of 8 runs **passed** | `oxlint`, `oxfmt --check` and the targeted `scripts/check-type.js` are clean on the changed file. ### ADDITIONAL INFORMATION - [x] Has associated issue: Fixes #44791 - [ ] 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 -- 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]
