SEPURI-SAI-KRISHNA opened a new issue, #44791:
URL: https://github.com/apache/superset/issues/44791
### Bug description
`src/features/semanticViews/AddSemanticViewModal.test.tsx` intermittently
fails in `sharded-jest-tests`:
```
● the save payload carries every selected metric
expect(jest.fn()).toHaveBeenCalledWith(...expected)
Expected: {"endpoint": "/api/v1/semantic_view/", "jsonPayload": {"views":
[...]}}
Received
1
- "endpoint": "/api/v1/semantic_view/",
+ "endpoint": "/api/v1/semantic_layer/layer-1/schema/runtime",
```
The create request is never issued at all — the received calls are only the
runtime-schema and views fetches.
Seen 8 times across 7 unrelated branches since 2026-09-21, including twice
on `master`:
| Branch | Run |
|---|---|
| `master` | https://github.com/apache/superset/actions/runs/36460676931
(2026-09-28) |
| `master` | https://github.com/apache/superset/actions/runs/35575827901
(2026-09-21) |
| `fix/44663-cell-bar-conditional-formatting` |
https://github.com/apache/superset/actions/runs/36185575141 |
| `fix-ai-page-context-framing` |
https://github.com/apache/superset/actions/runs/36271511655 |
**Reproduction.** It reproduces reliably under load — pinned to 2 cores with
10 busy loops running, the test failed **4 of 5 runs**. On an idle machine it
passes.
**Cause.** Each metric pick schedules a debounced views refetch
(`SCHEMA_REFRESH_DEBOUNCE_MS = 500`,
`src/features/semanticLayers/jsonFormsHelpers.tsx`), and a further fetch is
scheduled ~100 ms after a schema refresh settles. `fetchViews` clears the
current selection *before* awaiting its response:
```tsx
// src/features/semanticViews/AddSemanticViewModal.tsx
const fetchViews = useCallback(async (uuid, rData, gen) => {
setLoadingViews(true);
setAvailableViews([]);
setSelectedViewNames([]); // cleared before the POST resolves
```
The test waits only for the `Semantic views` combobox to become enabled,
which happens after the *first* fetch resolves. A later refetch can still be in
flight; when it lands after `orders` has been picked it clears
`selectedViewNames`, so `newViewCount` drops to 0 and `handleSave` returns
early:
```tsx
const handleSave = async () => {
if (!selectedLayerUuid || newViewCount === 0) return;
```
No POST is issued, and the assertion times out.
**This is not a timeout-budget problem.** The final `waitFor` uses the
default 1000 ms while its siblings use 10 000 ms, so that looked like the
obvious cause — but raising only that timeout to 10 000 ms made it *worse* (0/5
passes instead of 1/5). An instrumented run confirmed the request never
happens: after the click, zero `/api/v1/semantic_view/` calls, and after
letting every debounce settle the `Add 1 view(s)` button is gone entirely, i.e.
the count had fallen back to 0.
**Follow-up, filed separately.** That the selection can be discarded by a
background refresh, and that `handleSave` then silently does nothing with no
toast, is a product-level issue reachable by a real user. This issue covers
only the flaky test.
### Screenshots/recordings
_No response_
### Superset version
master / latest-dev
### Python version
N/A (frontend test)
### Node version
18 or greater (CI: 24.16.0)
### Browser
Not applicable
### Additional context
The file has not changed since #42535 (2026-08-03), and all of its
`userEvent` calls are already awaited, so this is unrelated to the `user-event`
v14 migration flakes (#44314, #44322, #44334).
### Checklist
- [x] I have searched Superset docs and Slack and didn't find a solution to
my problem.
- [x] I have searched the GitHub issue tracker and didn't find a similar bug
report.
- [x] I have checked Superset's logs for errors and if I found a relevant
Python stacktrace, I included it here as text in the "additional context"
section.
--
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]