-
Notifications
You must be signed in to change notification settings - Fork 637
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Summary: Updating `node-fetch` to the latest version caused tests in `packages/metro/src/integration_tests/__tests__/server-test.js` to fail. Running each test case inside the file failed individually, but there seems to have been a race condition between the tests causing subsequent tests to fail with the following error: ``` FetchError: request to http://localhost:10028/import-export/index.bundle?platform=ios&dev=true&minify=false failed, reason: socket hang up ``` It happens because the "connection: close" header is removed in the latest version of `node-fetch`: node-fetch/node-fetch#1765 and can be fixed by adding this header manually to fetches. ``` fetch('path', {headers: {'Connection': 'close'}}); ``` However, since we only use `node-fetch` in this test it seems like a good chance to remove it completely and use the native `fetch` provided by node (stable since Node.js v21, but works well in older node versions for the purpose of testing). The native fetch also defaults to `keepAlive: true` (https://github.com/nodejs/undici?tab=readme-ov-file#pipelining) which I manually tweaked to be false. Differential Revision: D61336391
- Loading branch information
1 parent
0a8cfb1
commit dcbc9ef
Showing
4 changed files
with
19 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters