Skip to content

Commit ac79853

Browse files
author
Luca Forstner
committed
Work aroud Node 20 bug
1 parent 8ae8d8d commit ac79853

File tree

1 file changed

+6
-2
lines changed
  • dev-packages/node-integration-tests/utils

1 file changed

+6
-2
lines changed

dev-packages/node-integration-tests/utils/index.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type * as http from 'http';
1+
import * as http from 'http';
22
import type { AddressInfo } from 'net';
33
import * as path from 'path';
44
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
@@ -212,7 +212,11 @@ export class TestEnv {
212212
endServer: boolean = true,
213213
): Promise<unknown> {
214214
try {
215-
const { data } = await axios.get(url || this.url, { headers });
215+
const { data } = await axios.get(url || this.url, {
216+
headers,
217+
// KeepAlive false to work around a Node 20 bug with ECONNRESET: https://github.com/axios/axios/issues/5929
218+
httpAgent: new http.Agent({ keepAlive: false }),
219+
});
216220
return data;
217221
} finally {
218222
await Sentry.flush();

0 commit comments

Comments
 (0)