potiuk opened a new pull request, #75084:
URL: https://github.com/apache/airflow/pull/75084

   Every run of the React UI unit tests printed about 13,000 lines of 
`AggregateError: connect ECONNREFUSED ::1:3000 / 127.0.0.1:3000`. The tests run 
under happy-dom with the origin `http://localhost:3000`, and the shared msw 
server let unhandled requests through to that address, where nothing listens. 
The noise buried real failures in the logs, and some tests quietly exercised 
the "request failed" path instead of the one they meant to.
   
   The requests came from three places:
   
   - endpoints with no handler: the page shell (`auth/me`, `auth/menus`, 
version, plugins, import errors, Dag warnings), the i18n bundles, generic Dag, 
Dag run, task and task instance lookups, grid and graph structure, the 
Admin/Browse list pages, Dag list state counts and teams, and the asset state 
store;
   - 12 test files that started a second msw server next to the one in 
`testsSetup.ts` — the two share msw's interception, so the global one shadowed 
the file's handlers and closing either released requests to the network;
   - requests sent at module import time (`src/i18n/config`), before the server 
started in `beforeAll`.
   
   This adds default handlers, exports one shared server that tests extend with 
`server.use()`, starts it at import time and leaves it open (each test file 
runs in its own worker). Unhandled requests now use the `"error"` strategy, and 
an `afterEach` fails any test that sent one, naming the method and URL. Three 
tests needed small adjustments (NotePreview no longer follows an external link, 
Callbacks re-queries its button after translations load, and the DagBreadcrumb 
loading test holds its request pending explicitly).
   
   Result: 240 test files / 1963 tests pass, with 0 `ECONNREFUSED` lines 
(previously ~13,000) and the log down from ~66,500 lines to ~130. eslint, tsc 
and prettier are clean.
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes — Claude Code (Opus 5.5)
   
   Generated-by: Claude Code (Opus 5.5) following [the 
guidelines](https://github.com/apache/airflow/blob/main/contributing-docs/05_pull_requests.rst#gen-ai-assisted-contributions)


-- 
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]

Reply via email to