Skip to content

Commit 054e0df

Browse files
retry with undici
1 parent a7ca859 commit 054e0df

1 file changed

Lines changed: 20 additions & 6 deletions

File tree

integration-tests/common/LoadTest.test.ts

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,26 @@ describe("Load Test for ECONNRESET", () => {
4444
`Sending ${CONCURRENT_REQUESTS} staggered requests (1 every 0ms)...`
4545
);
4646

47-
// Create an array to hold all the request promises.
48-
const requestPromises: Promise<any>[] = [];
49-
for (let i = 0; i < CONCURRENT_REQUESTS; i++) {
50-
// Start the request but don't wait for it to finish here.
51-
//requestPromises.push(executor.getWorkflow(executionId, false));
52-
requestPromises.push(fetch(`https://google.com/`));
47+
// Create an array to hold all the request promises.
48+
const { fetch: undiciFetch, Agent } = await import("undici");
49+
const undiciAgent = new Agent({
50+
//allowH2: true,
51+
connect: {
52+
timeout: 270000, // Connect timeout in milliseconds (e.g., 60 seconds)
53+
},
54+
});
55+
56+
// Create an array to hold all the request promises.
57+
const requestPromises: Promise<any>[] = [];
58+
for (let i = 0; i < CONCURRENT_REQUESTS; i++) {
59+
// Start the request but don't wait for it to finish here.
60+
//requestPromises.push(executor.getWorkflow(executionId, false));
61+
//requestPromises.push(fetch(`https://siliconmint-dev-5x.orkesconductor.io/`));
62+
requestPromises.push(
63+
undiciFetch(`https://google.com/`, {
64+
dispatcher: undiciAgent,
65+
})
66+
);
5367

5468
// if (i < CONCURRENT_REQUESTS - 1) {
5569
// // Wait 100ms before starting the next request.

0 commit comments

Comments
 (0)